aboutsummaryrefslogtreecommitdiffstats
path: root/libAACdec
diff options
context:
space:
mode:
authorJean-Michel Trivi <jmtrivi@google.com>2018-12-26 18:35:45 -0800
committerandroid-build-merger <android-build-merger@google.com>2018-12-26 18:35:45 -0800
commitcafc42b5eb188678d5690f7a7f0274a28837f46d (patch)
treeb3e0e90f622b840ef4e8fe495d851d2869e5b99f /libAACdec
parentd145d90619598cdcd441c18505a1b79d0300eff2 (diff)
parentca0d8e7461269c6d169aa70086ef8f26f43bcc90 (diff)
downloadfdk-aac-cafc42b5eb188678d5690f7a7f0274a28837f46d.tar.gz
fdk-aac-cafc42b5eb188678d5690f7a7f0274a28837f46d.tar.bz2
fdk-aac-cafc42b5eb188678d5690f7a7f0274a28837f46d.zip
Merge "Unsigned Integer Overflow in InitSegmentBitfield()" am: 4899e80a17
am: ca0d8e7461 Change-Id: Ia4e0396a4df14d667f80aded10631815b715e2c2
Diffstat (limited to 'libAACdec')
-rw-r--r--libAACdec/src/aacdec_hcrs.cpp5
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