shithub: openh264

Download patch

ref: 99412b0fc228beb56efaaaad25e3b6b543dbb519
parent: 493c31f6a6bf433637a0e24a888c7812b1676d7e
parent: 64380c46b8af0aaf34ed21495bbd6c3b9198950a
author: ruil2 <[email protected]>
date: Wed Jan 22 18:52:30 EST 2014

Merge pull request #167 from licaiguo/fix-961370

fix 961370 -- review request #50

--- a/codec/decoder/core/src/au_parser.cpp
+++ b/codec/decoder/core/src/au_parser.cpp
@@ -206,6 +206,16 @@
     pCurNal = &pCtx->sPrefixNal;
 
     if (iNalSize < NAL_UNIT_HEADER_EXT_SIZE) {
+      pCtx->iErrorCode |= dsBitstreamError;
+
+      PAccessUnit pCurAu	   = pCtx->pAccessUnitList;
+      uint32_t uiAvailNalNum = pCurAu->uiAvailUnitsNum;
+      ForceClearCurrentNal (pCurAu);
+
+      if (uiAvailNalNum > 1) {
+        pCurAu->uiEndPos = uiAvailNalNum - 2;
+        pCtx->bAuReadyFlag = true;
+      }
       return NULL;
     }
 
@@ -250,6 +260,14 @@
 
     if (pNalUnitHeader->eNalUnitType == NAL_UNIT_CODED_SLICE_EXT) {
       if (iNalSize < NAL_UNIT_HEADER_EXT_SIZE) {
+        pCtx->iErrorCode |= dsBitstreamError;
+
+        ForceClearCurrentNal (pCurAu);
+
+        if (uiAvailNalNum > 1) {
+          pCurAu->uiEndPos = uiAvailNalNum - 2;
+          pCtx->bAuReadyFlag = true;
+        }
         return NULL;
       }