shithub: openh264

Download patch

ref: b5a01efa967aabb90a69eb366eda0b3cc3bdfa67
parent: c1cc195ab1a389e8dbad22b588e413490fa13d30
author: ruil2 <ruil2@cisco.com>
date: Tue Sep 2 06:23:03 EDT 2014

avoid LTR reference frames overflow

--- a/codec/encoder/core/src/ref_list_mgr_svc.cpp
+++ b/codec/encoder/core/src/ref_list_mgr_svc.cpp
@@ -315,6 +315,10 @@
     }
     pLongRefList[0]	 = pShortRefList[i];
     pRefList->uiLongRefCount++;
+    if (pRefList->uiLongRefCount > pCtx->pSvcParam->iLTRRefNum) {
+      SetUnref (pRefList->pLongRefList[pRefList->uiLongRefCount - 1]);
+      DeleteLTRFromLongList (pCtx, pRefList->uiLongRefCount - 1);
+    }
     DeleteSTRFromShortList (pCtx, i);
   }
 }