diff options
author | Jean-Michel Trivi <jmtrivi@google.com> | 2018-12-27 02:10:25 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2018-12-27 02:10:25 +0000 |
commit | 4899e80a1725d07d028df4610e39b0c278a6252a (patch) | |
tree | b01d9477e78db0e42e513ec5634268f17bf4a51d /libAACdec | |
parent | 2f5612ef84892f51cf9c13dd245f4fbf9b4d0ab0 (diff) | |
parent | 950d8efb1a0562d1402b6c3379db4e17d71c7578 (diff) | |
download | fdk-aac-4899e80a1725d07d028df4610e39b0c278a6252a.tar.gz fdk-aac-4899e80a1725d07d028df4610e39b0c278a6252a.tar.bz2 fdk-aac-4899e80a1725d07d028df4610e39b0c278a6252a.zip |
Merge "Unsigned Integer Overflow in InitSegmentBitfield()"
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 |