diff options
author | Luca Barbato <lu_zero@gentoo.org> | 2012-10-26 22:55:04 +0200 |
---|---|---|
committer | Luca Barbato <lu_zero@gentoo.org> | 2012-10-28 05:07:55 +0100 |
commit | 424b1e764263b1493de4c34365ef367ddae856db (patch) | |
tree | 3665def47722d1f03c2ec61e0ab0af9dd518fbfe | |
parent | fce4450dec2f1287124a5c129281100f729f5771 (diff) | |
download | ffmpeg-424b1e764263b1493de4c34365ef367ddae856db.tar.gz |
yuv4mpeg: reject unsupported codecs
The muxer already rejects unsupported pixel formats, reject also
unsupported codecs to prevent dangerous misuses.
-rw-r--r-- | libavformat/yuv4mpeg.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libavformat/yuv4mpeg.c b/libavformat/yuv4mpeg.c index bdae17b93e..a8077a00f0 100644 --- a/libavformat/yuv4mpeg.c +++ b/libavformat/yuv4mpeg.c @@ -155,6 +155,11 @@ static int yuv4_write_header(AVFormatContext *s) if (s->nb_streams != 1) 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) { av_log(s, AV_LOG_ERROR, "Warning: generating rarely used 4:1:1 YUV " "stream, some mjpegtools might not work.\n"); |