1
0
mirror of https://github.com/mstorsjo/fdk-aac.git synced 2025-06-05 22:39:13 +02:00

Unsigned Integer Overflow in InitSegmentBitfield()

Bug: 112662995
Test: atest DecoderTestXheAac ; atest DecoderTestAacDrc
Change-Id: Ida3b1d49dc35a03a3ff02f6e150cfb55e9e1da11
This commit is contained in:
Fraunhofer IIS FDK
2018-06-29 16:34:55 +02:00
committed by Jean-Michel Trivi
parent f59fd73d44
commit 950d8efb1a

View File

@@ -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