shithub: openh264

Download patch

ref: fd100598abf639e18ea476267dee225f46746395
parent: e441ae2fd5651af70f1514bd50b784d522bf71a7
author: Martin Storsjö <martin@martin.st>
date: Tue Feb 18 07:46:33 EST 2014

Avoid declaring unused variables

Move the variable declarations within the ifdef instead.

--- a/codec/console/enc/src/welsenc.cpp
+++ b/codec/console/enc/src/welsenc.cpp
@@ -542,14 +542,15 @@
     }
 
     else if (!strcmp (pCommand, "-drec") && (n + 1 < argc)) {
+#ifdef ENABLE_FRAME_DUMP
       unsigned int	iLayer = atoi (argv[n++]);
       const int iLen = strlen (argv[n]);
-#ifdef ENABLE_FRAME_DUMP
       SDLayerParam* pDLayer = &pSvcParam.sDependencyLayers[iLayer];
       pDLayer->sRecFileName[iLen] = '\0';
-      strncpy (pDLayer->sRecFileName, argv[n], iLen);	// confirmed_safe_unsafe_usage
+      strncpy (pDLayer->sRecFileName, argv[n++], iLen);	// confirmed_safe_unsafe_usage
+#else
+      n += 2;
 #endif//ENABLE_FRAME_DUMP
-      n++;
     }
 
     else if (!strcmp (pCommand, "-sw") && (n + 1 < argc)) {