]> rtime.felk.cvut.cz Git - frescor/ffmpeg.git/commitdiff
check for palette presence, fix crash with QT-BMP.mov, issue #1074
authorbcoudurier <bcoudurier@9553f0bf-9b14-0410-a0b8-cfaf0461ba5b>
Sun, 10 May 2009 19:10:37 +0000 (19:10 +0000)
committerbcoudurier <bcoudurier@9553f0bf-9b14-0410-a0b8-cfaf0461ba5b>
Sun, 10 May 2009 19:10:37 +0000 (19:10 +0000)
git-svn-id: file:///var/local/repositories/ffmpeg/trunk@18785 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b

libavcodec/msrle.c

index 0d77e30c5efb257d826af05ba6815de142c2f0aa..0b64be12bb0924200fec3575fab1bc0a5ac97ec4 100644 (file)
@@ -79,12 +79,14 @@ static int msrle_decode_frame(AVCodecContext *avctx,
         return -1;
     }
 
+    if (s->avctx->palctrl) {
     /* make the palette available */
     memcpy(s->frame.data[1], s->avctx->palctrl->palette, AVPALETTE_SIZE);
     if (s->avctx->palctrl->palette_changed) {
         s->frame.palette_has_changed = 1;
         s->avctx->palctrl->palette_changed = 0;
     }
+    }
 
     ff_msrle_decode(avctx, (AVPicture*)&s->frame, avctx->bits_per_coded_sample, buf, buf_size);