diff options
author | Fraunhofer IIS FDK <audio-fdk@iis.fraunhofer.de> | 2019-10-29 13:09:38 +0100 |
---|---|---|
committer | Jean-Michel Trivi <jmtrivi@google.com> | 2019-12-27 10:22:23 -0800 |
commit | 2334454bc85e205b0d9f23ba6fbd1a966bf2c364 (patch) | |
tree | e6d7139e98061f6a919ca0db008a57e0a5db4059 /libAACdec/src/aacdec_hcrs.cpp | |
parent | 3700d4ff8fac723f4051a9d53dedae26393a2013 (diff) | |
download | fdk-aac-2334454bc85e205b0d9f23ba6fbd1a966bf2c364.tar.gz fdk-aac-2334454bc85e205b0d9f23ba6fbd1a966bf2c364.tar.bz2 fdk-aac-2334454bc85e205b0d9f23ba6fbd1a966bf2c364.zip |
Add sanity check for huffman escape sequences in HCR tool.
Bug: 145669389
Test: atest DecoderTestXheAac ; atest DecoderTestAacDrc
Change-Id: Iaa624f3040269b5c84883bc3ee38cad7cd88e54d
Diffstat (limited to 'libAACdec/src/aacdec_hcrs.cpp')
-rw-r--r-- | libAACdec/src/aacdec_hcrs.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/libAACdec/src/aacdec_hcrs.cpp b/libAACdec/src/aacdec_hcrs.cpp index d2bc867..44b32a5 100644 --- a/libAACdec/src/aacdec_hcrs.cpp +++ b/libAACdec/src/aacdec_hcrs.cpp @@ -1,7 +1,7 @@ /* ----------------------------------------------------------------------------- Software License for The Fraunhofer FDK AAC Codec Library for Android -© Copyright 1995 - 2018 Fraunhofer-Gesellschaft zur Förderung der angewandten +© Copyright 1995 - 2019 Fraunhofer-Gesellschaft zur Förderung der angewandten Forschung e.V. All rights reserved. 1. INTRODUCTION @@ -1324,6 +1324,10 @@ UINT Hcr_State_BODY_SIGN_ESC__ESC_PREFIX(HANDLE_FDK_BITSTREAM bs, void *ptr) { /* count ones and store sum in escapePrefixUp */ if (carryBit == 1) { escapePrefixUp += 1; /* update conter for ones */ + if (escapePrefixUp > 8) { + pHcr->decInOut.errorLog |= STATE_ERROR_BODY_SIGN_ESC__ESC_PREFIX; + return BODY_SIGN_ESC__ESC_PREFIX; + } /* store updated counter in sideinfo of current codeword */ pEscapeSequenceInfo[codewordOffset] &= |