Commit 47f2972b authored by reimar's avatar reimar

Check that palctrl is available on init instead of crashing when trying to use

it on decode.
Fixes mpeg2/smclockmpeg2.avi.2.1 from issue 1240.


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@19347 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 2c73d654
......@@ -289,6 +289,10 @@ static int decode_frame(AVCodecContext *avctx,
static av_cold int decode_init(AVCodecContext *avctx){
QpegContext * const a = avctx->priv_data;
if (!avctx->palctrl) {
av_log(avctx, AV_LOG_FATAL, "Missing required palette via palctrl\n");
return -1;
}
a->avctx = avctx;
avctx->pix_fmt= PIX_FMT_PAL8;
a->refdata = av_malloc(avctx->width * avctx->height);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment