shithub: openh264

Download patch

ref: 0fb5242b86eda91b4d4f94090b951b63c518e8ec
parent: 2273624a6a0d30f2359a8f706f2d47e94bd8c4c6
parent: 68d9bc230d7e20a818e5b0160a0b50861c83ecb4
author: huili2 <huili2@cisco.com>
date: Thu Aug 13 13:19:10 EDT 2015

Merge pull request #2071 from HaiboZhu/Bugfix_Encoder_DetectSceneChangeScreen_overflow

Add default when iCurTId invalid

--- a/codec/encoder/core/src/wels_preprocess.cpp
+++ b/codec/encoder/core/src/wels_preprocess.cpp
@@ -1037,7 +1037,7 @@
                                           (pCurPicture->iHeightInPixel >> 3) * STATIC_SCENE_MOTION_RATIO));
   const uint8_t iCurTid = GetTemporalLevel (&pSvcParam->sDependencyLayers[m_pEncCtx->sSpatialIndexMap[0].iDid],
                           m_pEncCtx->iCodingIndex, pSvcParam->uiGopSize);
-  const int32_t iClosestLtrFrameNum = pCtx->pLtr[iTargetDid].iLastLtrIdx[iCurTid];//TBD
+  const int32_t iClosestLtrFrameNum = (iCurTid != INVALID_TEMPORAL_ID ?  pCtx->pLtr[iTargetDid].iLastLtrIdx[iCurTid] : -1);//TBD
   if (pSvcParam->bEnableLongTermReference) {
     GetAvailableRefListLosslessScreenRefSelection (pSrcPicList, iCurTid, iClosestLtrFrameNum, &sAvailableRefList[0],
         iAvailableRefNum,