diff options
author | Carl Eugen Hoyos <ceffmpeg@gmail.com> | 2019-07-01 00:37:08 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2021-10-17 21:35:41 +0200 |
commit | ede7d9c4fa149f18b132ea9a1cc99f643e471759 (patch) | |
tree | e241507e00595bc326ecb94b3cd137a2f5658b24 | |
parent | 452faa80b431afb9ecfba9ef8e85856221d2a5ca (diff) | |
download | ffmpeg-ede7d9c4fa149f18b132ea9a1cc99f643e471759.tar.gz |
lavf/rawenc: Only accept the appropriate stream type for raw muxers.
This does not affect the rawvideo muxer.
Fixes ticket #7979.
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavformat/rawenc.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/libavformat/rawenc.c b/libavformat/rawenc.c index d65c7c7909..d8cdd94e78 100644 --- a/libavformat/rawenc.c +++ b/libavformat/rawenc.c @@ -36,6 +36,18 @@ static int force_one_stream(AVFormatContext *s) s->oformat->name); return AVERROR(EINVAL); } + if ( s->oformat->audio_codec != AV_CODEC_ID_NONE + && s->streams[0]->codec->codec_type != AVMEDIA_TYPE_AUDIO) { + av_log(s, AV_LOG_ERROR, "%s files have exactly one audio stream\n", + s->oformat->name); + return AVERROR(EINVAL); + } + if ( s->oformat->video_codec != AV_CODEC_ID_NONE + && s->streams[0]->codec->codec_type != AVMEDIA_TYPE_VIDEO) { + av_log(s, AV_LOG_ERROR, "%s files have exactly one video stream\n", + s->oformat->name); + return AVERROR(EINVAL); + } return 0; } |