avconv: Do not try to configure filter outputs without streams
authorLuca Barbato <lu_zero@gentoo.org>
Mon, 5 Oct 2015 18:49:55 +0000 (20:49 +0200)
committerLuca Barbato <lu_zero@gentoo.org>
Wed, 7 Oct 2015 16:45:50 +0000 (18:45 +0200)
Prevent a NULL-dereference.

CC: libav-stable@libav.org
avconv_filter.c

index 976d521..0127580 100644 (file)
@@ -702,8 +702,12 @@ int configure_filtergraph(FilterGraph *fg)
             return ret;
     avfilter_inout_free(&inputs);
 
-    for (cur = outputs, i = 0; cur; cur = cur->next, i++)
-        configure_output_filter(fg, fg->outputs[i], cur);
+    for (cur = outputs, i = 0; cur; cur = cur->next, i++) {
+        OutputFilter *ofilter = fg->outputs[i];
+        if (ofilter->ost)
+            configure_output_filter(fg, ofilter, cur);
+    }
+
     avfilter_inout_free(&outputs);
 
     if ((ret = avfilter_graph_config(fg->graph, NULL)) < 0)