ref: 5809db9eff6ac0c2c11a21ee5674dd563c7a7283
parent: 22e7750bb31165ff33665f6240a145ed0b50cbb8
author: Martin Storsjö <[email protected]>
date: Thu Aug 28 07:51:02 EDT 2014
Avoid using uninitialized memory in the motion estimation tests
--- a/test/encoder/EncUT_MotionEstimate.cpp
+++ b/test/encoder/EncUT_MotionEstimate.cpp
@@ -80,6 +80,7 @@
SWelsFuncPtrList sFuncList;
SWelsME sMe;
SSlice sSlice;
+ memset (&sSlice, 0, sizeof (sSlice));
const uint8_t kuiQp = rand() % 52;
InitMe (kuiQp, 648, m_uiMvdTableSize, m_pMvdCostTable, &sMe);
@@ -209,6 +210,7 @@
WelsInitSampleSadFunc (&sFuncList, 0); //test c functions
+ memset (&sSlice, 0, sizeof (sSlice));
memset (m_pSrc, 128, m_iWidth * m_iHeight);
memset (m_pRefStart, 0, m_iWidthExt * m_iHeightExt);
@@ -252,6 +254,8 @@
uint8_t* pRef = m_pRefStart + PADDING_LENGTH * m_iWidthExt + PADDING_LENGTH;
const int32_t kiMaxBlock16Sad = 72000;//a rough number
+ memset (&sSlice, 0, sizeof (sSlice));
+ memset (&sMe, 0, sizeof (sMe));
WelsInitSampleSadFunc (&sFuncList, 0); //test c functions
WelsInitMeFunc (&sFuncList, 0, iUsageType);