[FFmpeg-cvslog] r19347 - trunk/libavcodec/qpeg.c

reimar subversion
Sun Jul 5 14:14:06 CEST 2009


Author: reimar
Date: Sun Jul  5 14:14:05 2009
New Revision: 19347

Log:
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.

Modified:
   trunk/libavcodec/qpeg.c

Modified: trunk/libavcodec/qpeg.c
==============================================================================
--- trunk/libavcodec/qpeg.c	Sun Jul  5 01:59:10 2009	(r19346)
+++ trunk/libavcodec/qpeg.c	Sun Jul  5 14:14:05 2009	(r19347)
@@ -289,6 +289,10 @@ static int decode_frame(AVCodecContext *
 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-cvslog mailing list