[FFmpeg-devel] [PATCH] qpeg.c misses check for palctrl

Reimar Döffinger Reimar.Doeffinger
Sun Jul 5 12:40:48 CEST 2009


Hello,
mpeg2/smclockmpeg2.avi.2.1 from issue 1240 crashes because the qpeg
decoder uses avctx->palctrl without checking if it is available.
This fixes it:
Index: qpeg.c
===================================================================
--- qpeg.c      (revision 19346)
+++ qpeg.c      (working copy)
@@ -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);




More information about the ffmpeg-devel mailing list