changeset 9622:02715614161f libavcodec

check for palette presence, fix crash with QT-BMP.mov, issue #1074
author bcoudurier
date Sun, 10 May 2009 19:10:37 +0000
parents 5680832edb83
children 5083846ac1f3
files msrle.c
diffstat 1 files changed, 2 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/msrle.c	Sun May 10 14:44:09 2009 +0000
+++ b/msrle.c	Sun May 10 19:10:37 2009 +0000
@@ -79,12 +79,14 @@
         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);