aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat
diff options
context:
space:
mode:
authorLuca Barbato <lu_zero@gentoo.org>2012-10-26 22:55:04 +0200
committerReinhard Tartler <siretart@tauware.de>2013-01-12 19:20:27 +0100
commitf3f22f183fa298f73b1c6a27a19436a22d7ff23a (patch)
tree9b9832592dff2b7ede926987e4e9289bdc07bc6f /libavformat
parentbfbff1c7483cd423ef7e0618cd67adf7d988376a (diff)
downloadffmpeg-f3f22f183fa298f73b1c6a27a19436a22d7ff23a.tar.gz
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@tauware.de>
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/yuv4mpeg.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavformat/yuv4mpeg.c b/libavformat/yuv4mpeg.c
index dd785c674f..e4b1e12266 100644
--- a/libavformat/yuv4mpeg.c
+++ b/libavformat/yuv4mpeg.c
@@ -154,6 +154,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");
}