aboutsummaryrefslogtreecommitdiffstats
path: root/fftools/ffmpeg_filter.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2024-04-01 06:23:58 +0200
committerAnton Khirnov <anton@khirnov.net>2024-04-09 10:34:18 +0200
commit651c79da362b4a9f618458ddd08b92504ffb3b6d (patch)
tree1206e9024b9157f837bd77c84d66fa57ef08ec86 /fftools/ffmpeg_filter.c
parent8e35e33d42efb89ff7e3da92b841a3b43a5a95bc (diff)
downloadffmpeg-651c79da362b4a9f618458ddd08b92504ffb3b6d.tar.gz
fftools/ffmpeg_filter: check that filter type matches output stream type
For simple filtergraphs. For complex filtergraphs they always match.
Diffstat (limited to 'fftools/ffmpeg_filter.c')
-rw-r--r--fftools/ffmpeg_filter.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/fftools/ffmpeg_filter.c b/fftools/ffmpeg_filter.c
index 0d359303f7..a59c61b312 100644
--- a/fftools/ffmpeg_filter.c
+++ b/fftools/ffmpeg_filter.c
@@ -773,6 +773,7 @@ int ofilter_bind_ost(OutputFilter *ofilter, OutputStream *ost,
int ret;
av_assert0(!ofilter->ost);
+ av_assert0(ofilter->type == ost->type);
ofilter->ost = ost;
av_freep(&ofilter->linklabel);
@@ -1106,6 +1107,13 @@ int init_simple_filtergraph(InputStream *ist, OutputStream *ost,
graph_desc, fg->nb_inputs, fg->nb_outputs);
return AVERROR(EINVAL);
}
+ if (fg->outputs[0]->type != ost->type) {
+ av_log(fg, AV_LOG_ERROR, "Filtergraph has a %s output, cannot connect "
+ "it to %s output stream\n",
+ av_get_media_type_string(fg->outputs[0]->type),
+ av_get_media_type_string(ost->type));
+ return AVERROR(EINVAL);
+ }
ost->filter = fg->outputs[0];