shithub: openh264

Download patch

ref: 048dea434dca9611966ca324abd78d007bfe21ad
parent: a53377314a39495b20fc17bdd49f03ddf678e206
author: Licai Guo <guolicai@gmail.com>
date: Tue Jan 21 18:54:21 EST 2014

remove unnecessary check, confirmed safe usage

--- a/codec/decoder/core/src/decoder_core.cpp
+++ b/codec/decoder/core/src/decoder_core.cpp
@@ -1740,6 +1740,8 @@
   InitCurDqLayerData (pCtx, pCtx->pCurDqLayer);
 
   pNalCur = pCurAu->pNalUnitsList[iIdx];
+  if (pNalCur == NULL)
+    return ERR_NONE;
   while (iIdx <= iEndIdx) {
     PDqLayer dq_cur							= pCtx->pCurDqLayer;
     SLayerInfo pLayerInfo;
@@ -1774,7 +1776,7 @@
     }
     GetI4LumaIChromaAddrTable (pCtx->iDecBlockOffsetArray, pCtx->pDec->iLinesize[0], pCtx->pDec->iLinesize[1]);
 
-    if ((pNalCur == NULL) || (pNalCur->sNalHeaderExt.uiLayerDqId > kuiTargetLayerDqId)) {
+    if (pNalCur->sNalHeaderExt.uiLayerDqId > kuiTargetLayerDqId) { // confirmed pNalCur will never be NULL
       break;	// Per formance it need not to decode the remaining bits any more due to given uiLayerDqId required, 9/2/2009
     }