From 23c9ebffb5e2e9a525d19a8b9c31879ec7012fc9 Mon Sep 17 00:00:00 2001
From: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Date: Thu, 2 Oct 2014 11:55:52 +0100
Subject: [PATCH] avfilter: Properly check for failed format query

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
---
 libavfilter/avfiltergraph.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/libavfilter/avfiltergraph.c b/libavfilter/avfiltergraph.c
index 9178939f771..a859ecbde98 100644
--- a/libavfilter/avfiltergraph.c
+++ b/libavfilter/avfiltergraph.c
@@ -559,7 +559,9 @@ static int query_formats(AVFilterGraph *graph, AVClass *log_ctx)
                 if ((ret = avfilter_insert_filter(link, convert, 0, 0)) < 0)
                     return ret;
 
-                filter_query_formats(convert);
+                if ((ret = filter_query_formats(convert)) < 0)
+                    return ret;
+
                 inlink  = convert->inputs[0];
                 outlink = convert->outputs[0];
                 av_assert0( inlink-> in_formats->refcount > 0);
-- 
GitLab