libavfilter/af_amerge: fix segfault if init fails.
authorNicolas George <nicolas.george@normalesup.org>
Thu, 21 Feb 2013 19:15:08 +0000 (20:15 +0100)
committerNicolas George <nicolas.george@normalesup.org>
Sun, 24 Feb 2013 10:23:51 +0000 (11:23 +0100)
libavfilter/af_amerge.c

index 357cbbe..2d68ea6 100644 (file)
@@ -63,8 +63,10 @@ static av_cold void uninit(AVFilterContext *ctx)
     int i;
 
     for (i = 0; i < am->nb_inputs; i++) {
-        ff_bufqueue_discard_all(&am->in[i].queue);
-        av_freep(&ctx->input_pads[i].name);
+        if (am->in)
+            ff_bufqueue_discard_all(&am->in[i].queue);
+        if (ctx->input_pads)
+            av_freep(&ctx->input_pads[i].name);
     }
     av_freep(&am->in);
 }