aboutsummaryrefslogtreecommitdiffstats
path: root/libDRCdec/src/drcDec_reader.cpp
diff options
context:
space:
mode:
authorFraunhofer IIS FDK <audio-fdk@iis.fraunhofer.de>2018-05-09 17:14:10 -0700
committerandroid-build-merger <android-build-merger@google.com>2018-05-09 17:14:10 -0700
commit57d474b424be58783e7abba469d2f3d800094967 (patch)
tree756d84f186478676d172f1afc3339c05c6b69709 /libDRCdec/src/drcDec_reader.cpp
parent259a3c5bd5eb9be666f40dfb2978502533dd2b82 (diff)
parent44ac411683e7cfbfdb1f58e02d54377d709c8dd4 (diff)
downloadfdk-aac-57d474b424be58783e7abba469d2f3d800094967.tar.gz
fdk-aac-57d474b424be58783e7abba469d2f3d800094967.tar.bz2
fdk-aac-57d474b424be58783e7abba469d2f3d800094967.zip
FDK patches: fix overflows in decoder out-of-band config
am: 44ac411683 Change-Id: I8b82f2a074eac9906d6e7badaf1cbb449ad13bdf
Diffstat (limited to 'libDRCdec/src/drcDec_reader.cpp')
-rw-r--r--libDRCdec/src/drcDec_reader.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/libDRCdec/src/drcDec_reader.cpp b/libDRCdec/src/drcDec_reader.cpp
index db5fab7..6fe7a04 100644
--- a/libDRCdec/src/drcDec_reader.cpp
+++ b/libDRCdec/src/drcDec_reader.cpp
@@ -1622,7 +1622,7 @@ static DRC_ERROR _readUniDrcConfigExtension(
HANDLE_FDK_BITSTREAM hBs, HANDLE_UNI_DRC_CONFIG hUniDrcConfig) {
DRC_ERROR err = DE_OK;
int k, bitSizeLen, extSizeBits, bitSize;
- UINT nBitsRemaining;
+ INT nBitsRemaining;
UNI_DRC_CONFIG_EXTENSION* pExt = &(hUniDrcConfig->uniDrcConfigExt);
k = 0;
@@ -1634,13 +1634,14 @@ static DRC_ERROR _readUniDrcConfigExtension(
bitSize = FDKreadBits(hBs, extSizeBits);
pExt->extBitSize[k] = bitSize + 1;
- nBitsRemaining = FDKgetValidBits(hBs);
+ nBitsRemaining = (INT)FDKgetValidBits(hBs);
switch (pExt->uniDrcConfigExtType[k]) {
case UNIDRCCONFEXT_V1:
err = _readDrcExtensionV1(hBs, hUniDrcConfig);
if (err) return err;
- if (nBitsRemaining != (pExt->extBitSize[k] + FDKgetValidBits(hBs)))
+ if (nBitsRemaining !=
+ ((INT)pExt->extBitSize[k] + (INT)FDKgetValidBits(hBs)))
return DE_NOT_OK;
break;
case UNIDRCCONFEXT_PARAM_DRC:
@@ -1940,7 +1941,7 @@ static DRC_ERROR _readLoudnessInfoSetExtension(
HANDLE_FDK_BITSTREAM hBs, HANDLE_LOUDNESS_INFO_SET hLoudnessInfoSet) {
DRC_ERROR err = DE_OK;
int k, bitSizeLen, extSizeBits, bitSize;
- UINT nBitsRemaining;
+ INT nBitsRemaining;
LOUDNESS_INFO_SET_EXTENSION* pExt = &(hLoudnessInfoSet->loudnessInfoSetExt);
k = 0;
@@ -1952,13 +1953,14 @@ static DRC_ERROR _readLoudnessInfoSetExtension(
bitSize = FDKreadBits(hBs, extSizeBits);
pExt->extBitSize[k] = bitSize + 1;
- nBitsRemaining = FDKgetValidBits(hBs);
+ nBitsRemaining = (INT)FDKgetValidBits(hBs);
switch (pExt->loudnessInfoSetExtType[k]) {
case UNIDRCLOUDEXT_EQ:
err = _readLoudnessInfoSetExtEq(hBs, hLoudnessInfoSet);
if (err) return err;
- if (nBitsRemaining != (pExt->extBitSize[k] + FDKgetValidBits(hBs)))
+ if (nBitsRemaining !=
+ ((INT)pExt->extBitSize[k] + (INT)FDKgetValidBits(hBs)))
return DE_NOT_OK;
break;
/* add future extensions here */