summaryrefslogtreecommitdiff
path: root/libavcodec/msrle.c
diff options
context:
space:
mode:
authorBaptiste Coudurier <baptiste.coudurier@gmail.com>2009-05-10 19:10:37 +0000
committerBaptiste Coudurier <baptiste.coudurier@gmail.com>2009-05-10 19:10:37 +0000
commita7e562291d16118f5d76ae39ee7ef721fa3ce04e (patch)
treee538b8f2d1113bb32c5659c309dcd14128ea60b8 /libavcodec/msrle.c
parent841b45e55d4c657fefb89005fa543b8709ce0cec (diff)
check for palette presence, fix crash with QT-BMP.mov, issue #1074
Originally committed as revision 18785 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/msrle.c')
-rw-r--r--libavcodec/msrle.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavcodec/msrle.c b/libavcodec/msrle.c
index 0d77e30c5e..0b64be12bb 100644
--- a/libavcodec/msrle.c
+++ b/libavcodec/msrle.c
@@ -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);