[FFmpeg-cvslog] yuv4mpeg: reject unsupported codecs
Luca Barbato
git at videolan.org
Mon Feb 11 12:41:05 CET 2013
ffmpeg | branch: release/0.5 | Luca Barbato <lu_zero at gentoo.org> | Fri Oct 26 22:55:04 2012 +0200| [1f1b2f18067bef0339c5b223a06421ed200ed60c] | committer: Reinhard Tartler
yuv4mpeg: reject unsupported codecs
The muxer already rejects unsupported pixel formats, reject also
unsupported codecs to prevent dangerous misuses.
(cherry picked from commit 424b1e764263b1493de4c34365ef367ddae856db)
Conflicts:
libavformat/yuv4mpeg.c
Signed-off-by: Reinhard Tartler <siretart at tauware.de>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=1f1b2f18067bef0339c5b223a06421ed200ed60c
---
libavformat/yuv4mpeg.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/libavformat/yuv4mpeg.c b/libavformat/yuv4mpeg.c
index 1f3892f..19e8be7 100644
--- a/libavformat/yuv4mpeg.c
+++ b/libavformat/yuv4mpeg.c
@@ -152,6 +152,11 @@ static int yuv4_write_header(AVFormatContext *s)
if (s->nb_streams != 1)
return AVERROR(EIO);
+ if (s->streams[0]->codec->codec_id != CODEC_ID_RAWVIDEO) {
+ av_log(s, AV_LOG_ERROR, "ERROR: Only rawvideo supported.\n");
+ return AVERROR_INVALIDDATA;
+ }
+
if (s->streams[0]->codec->pix_fmt == PIX_FMT_YUV411P) {
av_log(s, AV_LOG_ERROR, "Warning: generating rarely used 4:1:1 YUV stream, some mjpegtools might not work.\n");
}
More information about the ffmpeg-cvslog
mailing list