aboutsummaryrefslogtreecommitdiffstats
path: root/libFDK/src/FDK_crc.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 /libFDK/src/FDK_crc.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 'libFDK/src/FDK_crc.cpp')
-rw-r--r--libFDK/src/FDK_crc.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/libFDK/src/FDK_crc.cpp b/libFDK/src/FDK_crc.cpp
index 39f87d3..e208338 100644
--- a/libFDK/src/FDK_crc.cpp
+++ b/libFDK/src/FDK_crc.cpp
@@ -281,7 +281,7 @@ INT FDKcrcStartReg(HANDLE_FDK_CRCINFO hCrcInfo, const HANDLE_FDK_BITSTREAM hBs,
FDK_ASSERT(hCrcInfo->crcRegData[reg].isActive == 0);
hCrcInfo->crcRegData[reg].isActive = 1;
hCrcInfo->crcRegData[reg].maxBits = mBits;
- hCrcInfo->crcRegData[reg].validBits = FDKgetValidBits(hBs);
+ hCrcInfo->crcRegData[reg].validBits = (INT)FDKgetValidBits(hBs);
hCrcInfo->crcRegData[reg].bitBufCntBits = 0;
hCrcInfo->regStart = (hCrcInfo->regStart + 1) % MAX_CRC_REGS;
@@ -296,10 +296,10 @@ INT FDKcrcEndReg(HANDLE_FDK_CRCINFO hCrcInfo, const HANDLE_FDK_BITSTREAM hBs,
if (hBs->ConfigCache == BS_WRITER) {
hCrcInfo->crcRegData[reg].bitBufCntBits =
- FDKgetValidBits(hBs) - hCrcInfo->crcRegData[reg].validBits;
+ (INT)FDKgetValidBits(hBs) - hCrcInfo->crcRegData[reg].validBits;
} else {
hCrcInfo->crcRegData[reg].bitBufCntBits =
- hCrcInfo->crcRegData[reg].validBits - FDKgetValidBits(hBs);
+ hCrcInfo->crcRegData[reg].validBits - (INT)FDKgetValidBits(hBs);
}
if (hCrcInfo->crcRegData[reg].maxBits == 0) {
@@ -432,7 +432,7 @@ static void crcCalc(HANDLE_FDK_CRCINFO hCrcInfo, HANDLE_FDK_BITSTREAM hBs,
if (hBs->ConfigCache == BS_READER) {
bsReader = *hBs;
FDKpushBiDirectional(&bsReader,
- -(INT)(rD->validBits - FDKgetValidBits(&bsReader)));
+ -(rD->validBits - (INT)FDKgetValidBits(&bsReader)));
} else {
FDKinitBitStream(&bsReader, hBs->hBitBuf.Buffer, hBs->hBitBuf.bufSize,
hBs->hBitBuf.ValidBits, BS_READER);
@@ -441,7 +441,7 @@ static void crcCalc(HANDLE_FDK_CRCINFO hCrcInfo, HANDLE_FDK_BITSTREAM hBs,
int bits, rBits;
rBits = (rD->maxBits >= 0) ? rD->maxBits : -rD->maxBits; /* ramaining bits */
- if ((rD->maxBits > 0) && (((INT)rD->bitBufCntBits >> 3 << 3) < rBits)) {
+ if ((rD->maxBits > 0) && ((rD->bitBufCntBits >> 3 << 3) < rBits)) {
bits = rD->bitBufCntBits;
} else {
bits = rBits;