aboutsummaryrefslogtreecommitdiffstats
path: root/libAACdec
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 /libAACdec
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 'libAACdec')
-rw-r--r--libAACdec/src/aacdecoder.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/libAACdec/src/aacdecoder.cpp b/libAACdec/src/aacdecoder.cpp
index 64adb56..3cbdffd 100644
--- a/libAACdec/src/aacdecoder.cpp
+++ b/libAACdec/src/aacdecoder.cpp
@@ -437,7 +437,8 @@ static AAC_DECODER_ERROR CDataStreamElement_Read(HANDLE_AACDECODER self,
UCHAR *elementInstanceTag,
UINT alignmentAnchor) {
AAC_DECODER_ERROR error = AAC_DEC_OK;
- UINT dataStart, dseBits;
+ UINT dseBits;
+ INT dataStart;
int dataByteAlignFlag, count;
FDK_ASSERT(self != NULL);
@@ -460,14 +461,14 @@ static AAC_DECODER_ERROR CDataStreamElement_Read(HANDLE_AACDECODER self,
FDKbyteAlign(bs, alignmentAnchor);
}
- dataStart = FDKgetValidBits(bs);
+ dataStart = (INT)FDKgetValidBits(bs);
error = CAacDecoder_AncDataParse(&self->ancData, bs, count);
transportDec_CrcEndReg(self->hInput, crcReg);
{
/* Move to the beginning of the data chunk */
- FDKpushBack(bs, dataStart - FDKgetValidBits(bs));
+ FDKpushBack(bs, dataStart - (INT)FDKgetValidBits(bs));
/* Read Anc data if available */
aacDecoder_drcMarkPayload(self->hDrcInfo, bs, DVB_DRC_ANC_DATA);
@@ -477,7 +478,7 @@ static AAC_DECODER_ERROR CDataStreamElement_Read(HANDLE_AACDECODER self,
PCMDMX_ERROR dmxErr = PCMDMX_OK;
/* Move to the beginning of the data chunk */
- FDKpushBack(bs, dataStart - FDKgetValidBits(bs));
+ FDKpushBack(bs, dataStart - (INT)FDKgetValidBits(bs));
/* Read DMX meta-data */
dmxErr = pcmDmx_Parse(self->hPcmUtils, bs, dseBits, 0 /* not mpeg2 */);
@@ -487,8 +488,7 @@ static AAC_DECODER_ERROR CDataStreamElement_Read(HANDLE_AACDECODER self,
}
/* Move to the very end of the element. */
- FDKpushBiDirectional(
- bs, (INT)FDKgetValidBits(bs) - (INT)dataStart + (INT)dseBits);
+ FDKpushBiDirectional(bs, (INT)FDKgetValidBits(bs) - dataStart + (INT)dseBits);
return error;
}