aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFraunhofer IIS FDK <audio-fdk@iis.fraunhofer.de>2018-05-25 19:12:04 -0700
committerandroid-build-merger <android-build-merger@google.com>2018-05-25 19:12:04 -0700
commitc2a874bf86993ec81cdc295d3f469903965c7553 (patch)
tree41c65cebd836ff3f949f1134512985e4a1288593
parenta2d2e68442571df4fa3ebfdc7a345ffa0bf35ee3 (diff)
parent1f93990cfc1bb76aa538634512938e39565f471a (diff)
downloadfdk-aac-c2a874bf86993ec81cdc295d3f469903965c7553.tar.gz
fdk-aac-c2a874bf86993ec81cdc295d3f469903965c7553.tar.bz2
fdk-aac-c2a874bf86993ec81cdc295d3f469903965c7553.zip
Fix unsigned integer overflow in aacDecoder_UpdateBitStreamCounters() am: f19e863cce
am: 1f93990cfc Change-Id: Ia29d1f4c6b384d6ddd3319378cbf402c2838b557
-rw-r--r--libAACdec/include/aacdecoder_lib.h18
-rw-r--r--libAACdec/src/aacdecoder_lib.cpp4
2 files changed, 12 insertions, 10 deletions
diff --git a/libAACdec/include/aacdecoder_lib.h b/libAACdec/include/aacdecoder_lib.h
index e811d04..3a9b910 100644
--- a/libAACdec/include/aacdecoder_lib.h
+++ b/libAACdec/include/aacdecoder_lib.h
@@ -861,14 +861,16 @@ typedef struct {
returns AAC_DEC_TRANSPORT_SYNC_ERROR. It will be
< 0 if the estimation failed. */
- UINT numTotalBytes; /*!< This is the number of total bytes that have passed
- through the decoder. */
- UINT numBadBytes; /*!< This is the number of total bytes that were considered
- with errors from numTotalBytes. */
- UINT numTotalAccessUnits; /*!< This is the number of total access units that
- have passed through the decoder. */
- UINT numBadAccessUnits; /*!< This is the number of total access units that
- were considered with errors from numTotalBytes. */
+ INT64 numTotalBytes; /*!< This is the number of total bytes that have passed
+ through the decoder. */
+ INT64
+ numBadBytes; /*!< This is the number of total bytes that were considered
+ with errors from numTotalBytes. */
+ INT64
+ numTotalAccessUnits; /*!< This is the number of total access units that
+ have passed through the decoder. */
+ INT64 numBadAccessUnits; /*!< This is the number of total access units that
+ were considered with errors from numTotalBytes. */
/* Metadata */
SCHAR drcProgRefLev; /*!< DRC program reference level. Defines the reference
diff --git a/libAACdec/src/aacdecoder_lib.cpp b/libAACdec/src/aacdecoder_lib.cpp
index cd112b6..d98cf5a 100644
--- a/libAACdec/src/aacdecoder_lib.cpp
+++ b/libAACdec/src/aacdecoder_lib.cpp
@@ -1085,12 +1085,12 @@ static void aacDecoder_UpdateBitStreamCounters(CStreamInfo *pSi,
INT nBytes;
nBytes = nBits >> 3;
- pSi->numTotalBytes = (UINT)((INT)pSi->numTotalBytes + nBytes);
+ pSi->numTotalBytes += nBytes;
if (IS_OUTPUT_VALID(ErrorStatus)) {
pSi->numTotalAccessUnits++;
}
if (IS_DECODE_ERROR(ErrorStatus)) {
- pSi->numBadBytes = (UINT)((INT)pSi->numBadBytes + nBytes);
+ pSi->numBadBytes += nBytes;
pSi->numBadAccessUnits++;
}
}