aboutsummaryrefslogtreecommitdiff
path: root/libavformat/yuv4mpeg.c
diff options
context:
space:
mode:
authorStefano Sabatini2011-05-30 17:09:12 +0200
committerStefano Sabatini2011-06-01 13:05:05 +0200
commit1f95fb58137951941d8d74bd47b1635b6d2399ec (patch)
tree4aed64d22e178295cbc5f4e6fc5d7e207b263402 /libavformat/yuv4mpeg.c
parentac41f3b036246e64d1724d945bea01d982bd1c91 (diff)
yuv4mpeg: complain and exit if a non-rawvideo stream is selected
The yuv4mpeg muxer will crash otherwise.
Diffstat (limited to 'libavformat/yuv4mpeg.c')
-rw-r--r--libavformat/yuv4mpeg.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/libavformat/yuv4mpeg.c b/libavformat/yuv4mpeg.c
index 445ec3701b..90b222d1d4 100644
--- a/libavformat/yuv4mpeg.c
+++ b/libavformat/yuv4mpeg.c
@@ -154,6 +154,12 @@ 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,
+ "A non-rawvideo stream was selected, but yuv4mpeg only handles rawvideo streams\n");
+ return AVERROR(EINVAL);
+ }
+
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");
}