shithub: openh264

Download patch

ref: bd8e2995adee0c47d909eb44a71ae6fe75a0c37f
parent: fd36d2ae0e6ec94bf4d11445e6335f2aaa637a7c
author: xiaotiansf <[email protected]>
date: Tue Jan 22 16:11:46 EST 2019

Fix Bugzilla Bug 152676

--- a/codec/decoder/plus/src/welsDecoderExt.cpp
+++ b/codec/decoder/plus/src/welsDecoderExt.cpp
@@ -798,7 +798,8 @@
       ppDst[1] = m_sPictInfoList[m_iPictInfoIndex].pData[1];
       ppDst[2] = m_sPictInfoList[m_iPictInfoIndex].pData[2];
       m_sPictInfoList[m_iPictInfoIndex].iPOC = sIMinInt32;
-      m_pDecContext->pPicBuff->ppPic[m_sPictInfoList[m_iPictInfoIndex].iPicBuffIdx]->bAvailableFlag = true;
+      if (m_sPictInfoList[m_iPictInfoIndex].iPicBuffIdx < m_pDecContext->pPicBuff->iCapacity)
+        m_pDecContext->pPicBuff->ppPic[m_sPictInfoList[m_iPictInfoIndex].iPicBuffIdx]->bAvailableFlag = true;
       m_sPictInfoList[m_iPictInfoIndex].bLastGOP = false;
       m_iMinPOC = sIMinInt32;
       --m_iNumOfPicts;
@@ -835,7 +836,8 @@
         ppDst[1] = m_sPictInfoList[m_iPictInfoIndex].pData[1];
         ppDst[2] = m_sPictInfoList[m_iPictInfoIndex].pData[2];
         m_sPictInfoList[m_iPictInfoIndex].iPOC = sIMinInt32;
-        m_pDecContext->pPicBuff->ppPic[m_sPictInfoList[m_iPictInfoIndex].iPicBuffIdx]->bAvailableFlag = true;
+        if (m_sPictInfoList[m_iPictInfoIndex].iPicBuffIdx < m_pDecContext->pPicBuff->iCapacity)
+          m_pDecContext->pPicBuff->ppPic[m_sPictInfoList[m_iPictInfoIndex].iPicBuffIdx]->bAvailableFlag = true;
         m_sPictInfoList[m_iPictInfoIndex].bLastGOP = false;
         m_iMinPOC = sIMinInt32;
         --m_iNumOfPicts;