ffmpeg: Initialize two stack variables.
authorCarl Eugen Hoyos <cehoyos@ag.or.at>
Tue, 21 Mar 2017 07:03:49 +0000 (08:03 +0100)
committerCarl Eugen Hoyos <cehoyos@ag.or.at>
Tue, 21 Mar 2017 07:04:59 +0000 (08:04 +0100)
Avoids reading from uninitialized memory, regression since af1761f7

ffmpeg.c

index dcb7720..4e6fc37 100644 (file)
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -1434,7 +1434,7 @@ static int reap_filters(int flush)
         filter = ost->filter->filter;
 
         if (!ost->initialized) {
-            char error[1024];
+            char error[1024] = "";
             ret = init_output_stream(ost, error, sizeof(error));
             if (ret < 0) {
                 av_log(NULL, AV_LOG_ERROR, "Error initializing output stream %d:%d -- %s\n",
@@ -1847,7 +1847,7 @@ static void flush_encoders(void)
         // Maybe we should just let encoding fail instead.
         if (!ost->initialized) {
             FilterGraph *fg = ost->filter->graph;
-            char error[1024];
+            char error[1024] = "";
 
             av_log(NULL, AV_LOG_WARNING,
                    "Finishing stream %d:%d without any data written to it.\n",