[FFmpeg-cvslog] lavfi/formats: more logical testing of inputs and outputs.

Nicolas George git at videolan.org
Tue Sep 8 15:26:21 EEST 2020


ffmpeg | branch: master | Nicolas George <george at nsup.org> | Sun Aug 23 11:52:16 2020 +0200| [fe964d80fec17f043763405f5804f397279d6b27] | committer: Nicolas George

lavfi/formats: more logical testing of inputs and outputs.

ff_set_common_formats() is currently only called after
graph_check_validity(), guaranteeing that inputs and outputs
are connected.
If we want to support configuring partially-connected graphs,
we will have a lot of redesign to do anyway.

Fix CID 1466262 / 1466263.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=fe964d80fec17f043763405f5804f397279d6b27
---

 libavfilter/formats.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavfilter/formats.c b/libavfilter/formats.c
index 95361170c5..c54aff688f 100644
--- a/libavfilter/formats.c
+++ b/libavfilter/formats.c
@@ -594,8 +594,8 @@ int ff_set_common_formats(AVFilterContext *ctx, AVFilterFormats *formats)
 int ff_default_query_formats(AVFilterContext *ctx)
 {
     int ret;
-    enum AVMediaType type = ctx->inputs  && ctx->inputs [0] ? ctx->inputs [0]->type :
-                            ctx->outputs && ctx->outputs[0] ? ctx->outputs[0]->type :
+    enum AVMediaType type = ctx->nb_inputs  ? ctx->inputs [0]->type :
+                            ctx->nb_outputs ? ctx->outputs[0]->type :
                             AVMEDIA_TYPE_VIDEO;
 
     ret = ff_set_common_formats(ctx, ff_all_formats(type));



More information about the ffmpeg-cvslog mailing list