shithub: openh264

Download patch

ref: e89f8a51b25fbe2ef5bba781b26236a53d09bc37
parent: 19b711bda6ac5e452cd36392b659a842f8511e7e
author: xiaotiansf <xiaotianshimail@gmail.com>
date: Mon Aug 20 06:34:16 EDT 2018

Another try: Fix Bug-1479831.

--- a/codec/decoder/core/src/cabac_decoder.cpp
+++ b/codec/decoder/core/src/cabac_decoder.cpp
@@ -145,8 +145,8 @@
   int32_t iRenorm = 1;
   uint32_t uiRangeLPS = g_kuiCabacRangeLps[uiState][ (uiRange >> 6) & 0x03];
   uiRange -= uiRangeLPS;
-  if (uiOffset >= (uiRange << (uint32_t)pDecEngine->iBitsLeft)) { //LPS
-    uiOffset -= (uiRange << (uint32_t)pDecEngine->iBitsLeft);
+  if (uiOffset >= (uiRange << pDecEngine->iBitsLeft)) { //LPS
+    uiOffset -= (uiRange << pDecEngine->iBitsLeft);
     uiBinVal ^= 0x0001;
     if (!uiState)
       pBinCtx->uiMPS ^= 0x01;
--- a/codec/decoder/core/src/mv_pred.cpp
+++ b/codec/decoder/core/src/mv_pred.cpp
@@ -504,7 +504,7 @@
     iDiagonalRef[listIdx] = iRightTopRef[listIdx];
     if (REF_NOT_AVAIL == iDiagonalRef[listIdx]) {
       iDiagonalRef[listIdx] = iLeftTopRef[listIdx];
-      * (int32_t*)iMvC[listIdx] = * (int32_t*)iMvD[listIdx];
+      ST32 (iMvC[listIdx], LD32 (iMvD[listIdx]));
     }
 
     int8_t ref_temp = WELS_MIN_POSITIVE (iTopRef[listIdx], iDiagonalRef[listIdx]);
--- a/codec/decoder/core/src/parse_mb_syn_cabac.cpp
+++ b/codec/decoder/core/src/parse_mb_syn_cabac.cpp
@@ -80,7 +80,7 @@
     return 0; /* I4x4 */
   }
 
-  DecodeTerminateCabac (pCabacDecEngine, uiCode);
+  WELS_READ_VERIFY (DecodeTerminateCabac (pCabacDecEngine, uiCode));
   if (uiCode) {
     return 25; /* PCM */
   }