You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-15 14:13:16 +02:00
yuv4mpeg: reject unsupported codecs
The muxer already rejects unsupported pixel formats, reject also unsupported codecs to prevent dangerous misuses.
This commit is contained in:
@@ -155,6 +155,11 @@ static int yuv4_write_header(AVFormatContext *s)
|
|||||||
if (s->nb_streams != 1)
|
if (s->nb_streams != 1)
|
||||||
return AVERROR(EIO);
|
return AVERROR(EIO);
|
||||||
|
|
||||||
|
if (s->streams[0]->codec->codec_id != AV_CODEC_ID_RAWVIDEO) {
|
||||||
|
av_log(s, AV_LOG_ERROR, "ERROR: Only rawvideo supported.\n");
|
||||||
|
return AVERROR_INVALIDDATA;
|
||||||
|
}
|
||||||
|
|
||||||
if (s->streams[0]->codec->pix_fmt == AV_PIX_FMT_YUV411P) {
|
if (s->streams[0]->codec->pix_fmt == AV_PIX_FMT_YUV411P) {
|
||||||
av_log(s, AV_LOG_ERROR, "Warning: generating rarely used 4:1:1 YUV "
|
av_log(s, AV_LOG_ERROR, "Warning: generating rarely used 4:1:1 YUV "
|
||||||
"stream, some mjpegtools might not work.\n");
|
"stream, some mjpegtools might not work.\n");
|
||||||
|
Reference in New Issue
Block a user