shithub: openh264

Download patch

ref: cd1991a0e39a6429af387394056420f2a7d48608
parent: bbfc84007617cd5beef636c330f0e6fd25403546
parent: 5bf4e379a707e0bd95ef69d690d023b555c08658
author: ruil2 <ruil2@cisco.com>
date: Tue Jan 16 04:42:58 EST 2018

Merge pull request #2903 from mstorsjo/fix-valgrind

Initialize the frame buffer in EncodeDecodeTestAPIBase::InitialEncDec

--- a/test/api/encode_options_test.cpp
+++ b/test/api/encode_options_test.cpp
@@ -36,6 +36,7 @@
 
   //set a fixed random value
   iRandValue = rand() % 256;
+  memset (buf_.data(), iRandValue, frameSize);
   return true;
 }
 
@@ -2157,11 +2158,6 @@
   iSrcHeight = iHeight;
 
   ASSERT_TRUE (InitialEncDec (iSrcWidth, iSrcHeight));
-
-  int frameSize = EncPic.iPicWidth * EncPic.iPicHeight * 3 / 2;
-  int lumaSize = EncPic.iPicWidth * EncPic.iPicHeight;
-  memset (buf_.data(), iRandValue, lumaSize);
-  memset (buf_.data() + lumaSize, rand() % 256, (frameSize - lumaSize));
 
   iRet = encoder_->EncodeFrame (&EncPic, &info);