# HG changeset patch # User reimar # Date 1246796045 0 # Node ID de14016e0b2d45a14f791b407c086b1b92364551 # Parent 2e8083f6524e2714b25f75526b8315b837e76d34 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. diff -r 2e8083f6524e -r de14016e0b2d qpeg.c --- a/qpeg.c Sat Jul 04 23:59:10 2009 +0000 +++ b/qpeg.c Sun Jul 05 12:14:05 2009 +0000 @@ -289,6 +289,10 @@ 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);