shithub: openh264

Download patch

ref: 42132828da1d70360f223bedbca7ce8ab1fd8c3e
parent: f280a71c3f300d5d42a563bc9ae21bff46a6d7aa
parent: 8289b58daa76ab181e998a11f511fc906b0b39a3
author: ruil2 <ruil2@cisco.com>
date: Wed Dec 27 03:59:52 EST 2017

Merge pull request #2892 from mstorsjo/fix-valgrind

Fix running UnsupportedVideoSizeInput under valgrind

--- a/test/api/encode_options_test.cpp
+++ b/test/api/encode_options_test.cpp
@@ -2150,6 +2150,11 @@
 
   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);
 
   ASSERT_TRUE (iRet == cmResultSuccess) << "rv = " << iRet;