ref: 86c1f0d2c6aabb65b9278f76400bd151d4ff4997
parent: 1eb735299a4606c01b7abbb2f561e7a904e08c1c
author: Haibo Zhu <[email protected]>
date: Tue May 17 05:40:03 EDT 2016
Remove the undefined behavior waring in parse_cabac
--- a/codec/decoder/core/src/parse_mb_syn_cabac.cpp
+++ b/codec/decoder/core/src/parse_mb_syn_cabac.cpp
@@ -934,7 +934,8 @@
} else if (iResProperty == CHROMA_DC_U || iResProperty == CHROMA_DC_V) {
do {
if (pSignificantMap[j] != 0)
- sTCoeff[pScanTable[j]] = pCtx->bUseScalingList ? (pSignificantMap[j] * pDeQuantMul[0]) >> 4 :
+ sTCoeff[pScanTable[j]] = pCtx->bUseScalingList ? (int16_t) ((int64_t)pSignificantMap[j] *
+ (int64_t)pDeQuantMul[0] >> 4) :
(pSignificantMap[j] * pDeQuantMul[0]);
++j;
} while (j < 16);
@@ -941,7 +942,8 @@
} else { //luma ac, chroma ac
do {
if (pSignificantMap[j] != 0)
- sTCoeff[pScanTable[j]] = pCtx->bUseScalingList ? (pSignificantMap[j] * pDeQuantMul[pScanTable[j]] >> 4) :
+ sTCoeff[pScanTable[j]] = pCtx->bUseScalingList ? (int16_t) ((int64_t)pSignificantMap[j] *
+ (int64_t)pDeQuantMul[pScanTable[j]] >> 4) :
pSignificantMap[j] * pDeQuantMul[pScanTable[j] & 0x07];
++j;
} while (j < 16);