shithub: openh264

Download patch

ref: c23b1406368e71437c05f62bd87dc149325d7e4a
parent: 664127f39f17c9e935d19a221fdeb6da8053bd72
author: Huade Shi (huashi) <huashi@cisco.com>
date: Tue May 9 10:20:48 EDT 2017

reallocate UT pointer null memory issue fixes

--- a/test/encoder/EncUT_SliceBufferReallocate.cpp
+++ b/test/encoder/EncUT_SliceBufferReallocate.cpp
@@ -164,8 +164,8 @@
 
 void CSliceBufferReallocatTest::InitParamForTestCase (int32_t iLayerIdx) {
   InitParam();
-  InitLayerSliceBuffer (iLayerIdx);
   InitFrameBsBuffer();
+  InitLayerSliceBuffer (iLayerIdx);
 
   //param validation
   int32_t iRet = m_pEncoder->InitializeExt ((SEncParamExt*)m_EncContext.pSvcParam);
@@ -177,6 +177,7 @@
   int32_t iRet = 0;
 
   InitParam();
+  InitFrameBsBuffer();
   InitLayerSliceBuffer (iLayerIdx);
 
   if (SM_SIZELIMITED_SLICE != pSliceArgument->uiSliceMode && NULL != m_EncContext.ppDqLayerList[iLayerIdx]) {
@@ -186,7 +187,6 @@
     EXPECT_TRUE (ENC_RETURN_SUCCESS == iRet);
     EXPECT_TRUE (NULL != m_EncContext.ppDqLayerList[iLayerIdx]);
   }
-  InitFrameBsBuffer();
 
   //param validation
   iRet = m_pEncoder->InitializeExt ((SEncParamExt*)m_EncContext.pSvcParam);