shithub: openh264

Download patch

ref: 7208ed14b137582c16dc6231ecc1f12f7f99d71c
parent: e29ceca39267a98ca93088392bd2a7e44470e6f1
author: Martin Storsjö <martin@martin.st>
date: Wed Feb 18 20:08:44 EST 2015

Store a const char* instead of a std::string in gtest parameter arrays

This avoids valgrind warnings about using unintialized data.

--- a/test/api/encode_decode_api_test.cpp
+++ b/test/api/encode_decode_api_test.cpp
@@ -3401,7 +3401,7 @@
   int uiMaxNalLen;
   float fFramerate;
   int iThreads;
-  std::string sFileSave;
+  const char* sFileSave;
 };
 
 static const EncodeOptionParam kOptionParamArray[] = {
@@ -3466,8 +3466,8 @@
   srand(1002);
   EncodeOptionParam p = GetParam();
   FILE * pFile = NULL;
-  if(!p.sFileSave.empty()) {
-    pFile = fopen(p.sFileSave.c_str(), "wb");
+  if (p.sFileSave != NULL && strlen(p.sFileSave) > 0) {
+    pFile = fopen(p.sFileSave, "wb");
   }
   memset (&param_, 0, sizeof (SEncParamExt));
   encoder_->GetDefaultParams (&param_);