diff options
author | Jean-Michel Trivi <jmtrivi@google.com> | 2018-12-26 18:53:44 -0800 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2018-12-26 18:53:44 -0800 |
commit | 437b7440d181130b9b09c0439113fb5257e55457 (patch) | |
tree | a7b72a5241cda4185bed1457b98e9b88710f30ea /libAACdec | |
parent | 6a506100ee6609bdacf2d1b13ac4a50598e30a8e (diff) | |
parent | cafc42b5eb188678d5690f7a7f0274a28837f46d (diff) | |
download | fdk-aac-437b7440d181130b9b09c0439113fb5257e55457.tar.gz fdk-aac-437b7440d181130b9b09c0439113fb5257e55457.tar.bz2 fdk-aac-437b7440d181130b9b09c0439113fb5257e55457.zip |
Merge "Unsigned Integer Overflow in InitSegmentBitfield()" am: 4899e80a17 am: ca0d8e7461
am: cafc42b5eb
Change-Id: Icd717282e22dfb01b678836f0a50eb9b56db9f0f
Diffstat (limited to 'libAACdec')
-rw-r--r-- | libAACdec/src/aacdec_hcrs.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/libAACdec/src/aacdec_hcrs.cpp b/libAACdec/src/aacdec_hcrs.cpp index 1d5aa27..d2bc867 100644 --- a/libAACdec/src/aacdec_hcrs.cpp +++ b/libAACdec/src/aacdec_hcrs.cpp @@ -367,7 +367,10 @@ static UINT InitSegmentBitfield(UINT *pNumSegment, UINT tempWord; USHORT numValidSegment; - *pNumWordForBitfield = ((*pNumSegment - 1) >> THIRTYTWO_LOG_DIV_TWO_LOG) + 1; + *pNumWordForBitfield = + (*pNumSegment == 0) + ? 0 + : ((*pNumSegment - 1) >> THIRTYTWO_LOG_DIV_TWO_LOG) + 1; /* loop over all words, which are completely used or only partial */ /* bit in pSegmentBitfield is zero if segment is empty; bit in |