diff options
author | Anton Khirnov <anton@khirnov.net> | 2023-05-11 11:02:36 +0200 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2023-05-22 17:10:44 +0200 |
commit | 65f3d042a614ed62f4bc272f3859bb092e56e35e (patch) | |
tree | 614cd969029fcca3e47d1205b0874e888f9b700d /fftools/ffmpeg_demux.c | |
parent | dfa29ba9550797881943fa5b12a8cf5f30a3e47c (diff) | |
download | ffmpeg-65f3d042a614ed62f4bc272f3859bb092e56e35e.tar.gz |
fftools/ffmpeg_demux: disallow using disabled input streams
This is less ad-hoc than checking explicitly in every place that binds
an input stream to a filter or output.
Diffstat (limited to 'fftools/ffmpeg_demux.c')
-rw-r--r-- | fftools/ffmpeg_demux.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/fftools/ffmpeg_demux.c b/fftools/ffmpeg_demux.c index ae2133bdbf..df87e0f30a 100644 --- a/fftools/ffmpeg_demux.c +++ b/fftools/ffmpeg_demux.c @@ -848,6 +848,12 @@ static int ist_use(InputStream *ist, int decoding_needed) { DemuxStream *ds = ds_from_ist(ist); + if (ist->user_set_discard == AVDISCARD_ALL) { + av_log(ist, AV_LOG_ERROR, "Cannot %s a disabled input stream\n", + decoding_needed ? "decode" : "streamcopy"); + return AVERROR(EINVAL); + } + ist->discard = 0; ist->st->discard = ist->user_set_discard; ist->decoding_needed |= decoding_needed; |