avmux: avoid to use unintialized variable
authorHaihao Xiang <haihao.xiang@intel.com>
Wed, 15 Apr 2020 07:00:02 +0000 (15:00 +0800)
committerHaihao Xiang <haihao.xiang@intel.com>
Wed, 15 Apr 2020 07:00:02 +0000 (15:00 +0800)
Without this fix, running the command below will get an error randomly.

Example:
gst-launch-1.0 videotestsrc ! vp9enc ! avmux_ivf ! fakesink

ERROR: pipeline doesn't want to preroll.
0:00:02.388528491 30148 0x5601b424a370 ERROR                  libav :0::
Tag [1]V[0][0] incompatible with output codec id '167' (VP90)

ext/libav/gstavmux.c

index 65fee93..30c7047 100644 (file)
@@ -482,6 +482,7 @@ gst_ffmpegmux_setcaps (GstPad * pad, GstCaps * caps)
   st = ffmpegmux->context->streams[collect_pad->padnum];
   av_opt_set_int (ffmpegmux->context, "preload", ffmpegmux->preload, 0);
   ffmpegmux->context->max_delay = ffmpegmux->max_delay;
+  memset (&tmp, 0, sizeof (tmp));
 
   /* for the format-specific guesses, we'll go to
    * our famous codec mapper */