[FFmpeg-devel] [PATCH 1/2] avfiltergraph: check query_formats return value.

Nicolas George nicolas.george at normalesup.org
Sun Jun 3 22:01:26 CEST 2012


Signed-off-by: Nicolas George <nicolas.george at normalesup.org>
---
 libavfilter/avfiltergraph.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/libavfilter/avfiltergraph.c b/libavfilter/avfiltergraph.c
index 8d2312e..92a8722 100644
--- a/libavfilter/avfiltergraph.c
+++ b/libavfilter/avfiltergraph.c
@@ -225,9 +225,11 @@ static int query_formats(AVFilterGraph *graph, AVClass *log_ctx)
     /* ask all the sub-filters for their supported media formats */
     for (i = 0; i < graph->filter_count; i++) {
         if (graph->filters[i]->filter->query_formats)
-            graph->filters[i]->filter->query_formats(graph->filters[i]);
+            ret = graph->filters[i]->filter->query_formats(graph->filters[i]);
         else
-            ff_default_query_formats(graph->filters[i]);
+            ret = ff_default_query_formats(graph->filters[i]);
+        if (ret < 0)
+            return ret;
     }
 
     /* go through and merge as many format lists as possible */
-- 
1.7.10



More information about the ffmpeg-devel mailing list