shithub: openh264

Download patch

ref: 3efc32a15e9773b6023805033d7b74f75862b8a6
parent: b9f937826ace85e6d1a0fae9544e9aa811cc6c5d
parent: 5ae7dc93b04122f19cbc09a2dbc89ac3f2e2a196
author: huili2 <huili2@cisco.com>
date: Sat Feb 9 09:51:26 EST 2019

Merge pull request #3098 from xiaotiansf/NewBugzilla2

Fix Bugzilla reported bug 1526408.

--- a/codec/console/dec/src/h264dec.cpp
+++ b/codec/console/dec/src/h264dec.cpp
@@ -148,7 +148,7 @@
 
   fseek (pH264File, 0L, SEEK_END);
   iFileSize = (int32_t) ftell (pH264File);
-  if (iFileSize <= 0) {
+  if (iFileSize <= 4) {
     fprintf (stderr, "Current Bit Stream File is too small, read error!!!!\n");
     goto label_exit;
   }
--- a/codec/decoder/core/src/decode_slice.cpp
+++ b/codec/decoder/core/src/decode_slice.cpp
@@ -1411,6 +1411,12 @@
     pCtx->bMbRefConcealed = pCtx->bRPLRError || pCtx->bMbRefConcealed || ! (ppRefPicL0[0] && ppRefPicL0[0]->bIsComplete)
                             || ! (ppRefPicL1[0] && ppRefPicL1[0]->bIsComplete);
 
+    if (pCtx->bMbRefConcealed) {
+      SLogContext* pLogCtx = & (pCtx->sLogCtx);
+      WelsLog (pLogCtx, WELS_LOG_ERROR, "Ref Picture for B-Slice is lost, B-Slice decoding cannot be continued!");
+      return GENERATE_ERROR_NO (ERR_LEVEL_SLICE_DATA, ERR_INFO_REFERENCE_PIC_LOST);
+    }
+
     SubMbType subMbType;
     if (pSliceHeader->iDirectSpatialMvPredFlag) {