shithub: openh264

Download patch

ref: a9006e4b5c3544cc248b117e8d2cf7df3cc7c1dc
parent: d9c90051dc36c9a387a4f9ae8f22e044f7b755db
author: xiaotianshi2 <xiaotianshimail2@gmail.com>
date: Sat Oct 10 13:21:13 EDT 2020

Fix openh264 issue 3345 (new oss-fuzz issues 25921, 25922, 25923, 25932, 25939, 25961
25970, 25973, 26060, 26068, 26078, 26114, 26169, 26198, 26220)

--- a/codec/decoder/plus/src/welsDecoderExt.cpp
+++ b/codec/decoder/plus/src/welsDecoderExt.cpp
@@ -811,6 +811,11 @@
       }
       return dsErrorFree;
     }
+    if ((pDecContext->iErrorCode & (dsBitstreamError | dsDataErrorConcealed)) && pDecContext->eSliceType == B_SLICE) {
+      ResetReorderingPictureBuffers (&m_sReoderingStatus, m_sPictInfoList, true);
+      WelsResetRefPic (pDecContext);
+      return dsErrorFree;
+    }
     //for AVC bitstream (excluding AVC with temporal scalability, including TP), as long as error occur, SHOULD notify upper layer key frame loss.
     if ((IS_PARAM_SETS_NALS (eNalType) || NAL_UNIT_CODED_SLICE_IDR == eNalType) ||
         (VIDEO_BITSTREAM_AVC == pDecContext->eVideoType)) {