ref: fb61733b2779477ab21b7fff64e8498c05e2d366
parent: ea52112d45feeb615b7fec52398ed1b2ed25e973
parent: f1d92ef36306f1e302b986f0d078211e0f968690
author: HaiboZhu <haibozhu@cisco.com>
date: Fri Oct 16 17:16:56 EDT 2015
Merge pull request #2163 from HaiboZhu/Remove_cabac_shift_exponent_too_large Remove the shift exponent too large warning
--- a/codec/decoder/core/inc/error_code.h
+++ b/codec/decoder/core/inc/error_code.h
@@ -196,6 +196,7 @@
ERR_INFO_INVALID_MMCO_LONG_TERM_IDX_EXCEED_MAX,
//for CABAC
ERR_CABAC_NO_BS_TO_READ,
+ERR_CABAC_UNEXPECTED_VALUE,
//for scaling list
ERR_SCALING_LIST_DELTA_SCALE,
};
--- a/codec/decoder/core/src/cabac_decoder.cpp
+++ b/codec/decoder/core/src/cabac_decoder.cpp
@@ -273,7 +273,10 @@
iSymTmp += (1 << iCount);
++iCount;
}
- } while (uiCode != 0);
+ } while (uiCode != 0 && iCount != 31);
+ if (iCount == 31) {
+ return ERR_CABAC_UNEXPECTED_VALUE;
+ }
while (iCount--) {
WELS_READ_VERIFY (DecodeBypassCabac (pDecEngine, uiCode));