1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-01-13 21:28:01 +02:00

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>
This commit is contained in:
Carl Eugen Hoyos 2019-07-01 00:37:08 +02:00 committed by Michael Niedermayer
parent 452faa80b4
commit ede7d9c4fa

View File

@ -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;
}