1
0
mirror of https://github.com/mstorsjo/fdk-aac.git synced 2025-02-11 17:10:50 +01:00

Fix unsigned integer overflow in aacDecoder_UpdateBitStreamCounters() am: f19e863cce

am: 1f93990cfc

Change-Id: Ia29d1f4c6b384d6ddd3319378cbf402c2838b557
This commit is contained in:
Fraunhofer IIS FDK 2018-05-25 19:12:04 -07:00 committed by android-build-merger
commit c2a874bf86
2 changed files with 12 additions and 10 deletions

View File

@ -861,13 +861,15 @@ typedef struct {
returns AAC_DEC_TRANSPORT_SYNC_ERROR. It will be returns AAC_DEC_TRANSPORT_SYNC_ERROR. It will be
< 0 if the estimation failed. */ < 0 if the estimation failed. */
UINT numTotalBytes; /*!< This is the number of total bytes that have passed INT64 numTotalBytes; /*!< This is the number of total bytes that have passed
through the decoder. */ through the decoder. */
UINT numBadBytes; /*!< This is the number of total bytes that were considered INT64
numBadBytes; /*!< This is the number of total bytes that were considered
with errors from numTotalBytes. */ with errors from numTotalBytes. */
UINT numTotalAccessUnits; /*!< This is the number of total access units that INT64
numTotalAccessUnits; /*!< This is the number of total access units that
have passed through the decoder. */ have passed through the decoder. */
UINT numBadAccessUnits; /*!< This is the number of total access units that INT64 numBadAccessUnits; /*!< This is the number of total access units that
were considered with errors from numTotalBytes. */ were considered with errors from numTotalBytes. */
/* Metadata */ /* Metadata */

View File

@ -1085,12 +1085,12 @@ static void aacDecoder_UpdateBitStreamCounters(CStreamInfo *pSi,
INT nBytes; INT nBytes;
nBytes = nBits >> 3; nBytes = nBits >> 3;
pSi->numTotalBytes = (UINT)((INT)pSi->numTotalBytes + nBytes); pSi->numTotalBytes += nBytes;
if (IS_OUTPUT_VALID(ErrorStatus)) { if (IS_OUTPUT_VALID(ErrorStatus)) {
pSi->numTotalAccessUnits++; pSi->numTotalAccessUnits++;
} }
if (IS_DECODE_ERROR(ErrorStatus)) { if (IS_DECODE_ERROR(ErrorStatus)) {
pSi->numBadBytes = (UINT)((INT)pSi->numBadBytes + nBytes); pSi->numBadBytes += nBytes;
pSi->numBadAccessUnits++; pSi->numBadAccessUnits++;
} }
} }