shithub: openh264

Download patch

ref: 2bc7d2bf8603fdb941b17ec413cf92632d507b27
parent: 301fd58c045e6e82618f014436133c01405a8a38
author: Varun B Patil <varun.basavaraj.patil@gmail.com>
date: Wed Dec 18 06:32:40 EST 2013

memset not required as struct is already initialized to 0.

Moreover, memset causes loss of sDecParam.sVideoProperty.size
that was set previously.

--- a/codec/console/dec/src/h264dec.cpp
+++ b/codec/console/dec/src/h264dec.cpp
@@ -344,7 +344,6 @@
         printf ("Specified file: %s not exist, maybe invalid path or parameter settting.\n", cReadCfg.GetFileName().c_str());
         return 1;
       }
-      memset (&sDecParam, 0, sizeof (sDecParam));
 
       while (!cReadCfg.EndOfFile()) {
         long nRd = cReadCfg.ReadLine (&strTag[0]);
@@ -382,7 +381,6 @@
     } else if (strstr (pArgV[1],
                        ".264")) { // no output dump yuv file, just try to render the decoded pictures //confirmed_safe_unsafe_usage
       strInputFile	= pArgV[1];
-      memset (&sDecParam, 0, sizeof (sDecParam));
       sDecParam.iOutputColorFormat          = videoFormatI420;
       sDecParam.uiTargetDqLayer	          = (uint8_t) - 1;
       sDecParam.uiEcActiveFlag	          = 1;
@@ -391,7 +389,6 @@
   } else { //iArgC > 2
     strInputFile	= pArgV[1];
     strOutputFile	= pArgV[2];
-    memset (&sDecParam, 0, sizeof (sDecParam));
     sDecParam.iOutputColorFormat	= videoFormatI420;
     sDecParam.uiTargetDqLayer	= (uint8_t) - 1;
     sDecParam.uiEcActiveFlag	= 1;