提交 1f95fb58 编写于 作者: S Stefano Sabatini

yuv4mpeg: complain and exit if a non-rawvideo stream is selected

The yuv4mpeg muxer will crash otherwise.
上级 ac41f3b0
......@@ -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");
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册