Commit de224060 authored by bcoudurier's avatar bcoudurier

check for palette presence, fix crash with QT-BMP.mov, issue #1074

git-svn-id: file:///var/local/repositories/ffmpeg/trunk@18785 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 396e441d
...@@ -79,12 +79,14 @@ static int msrle_decode_frame(AVCodecContext *avctx, ...@@ -79,12 +79,14 @@ static int msrle_decode_frame(AVCodecContext *avctx,
return -1; return -1;
} }
if (s->avctx->palctrl) {
/* make the palette available */ /* make the palette available */
memcpy(s->frame.data[1], s->avctx->palctrl->palette, AVPALETTE_SIZE); memcpy(s->frame.data[1], s->avctx->palctrl->palette, AVPALETTE_SIZE);
if (s->avctx->palctrl->palette_changed) { if (s->avctx->palctrl->palette_changed) {
s->frame.palette_has_changed = 1; s->frame.palette_has_changed = 1;
s->avctx->palctrl->palette_changed = 0; s->avctx->palctrl->palette_changed = 0;
} }
}
ff_msrle_decode(avctx, (AVPicture*)&s->frame, avctx->bits_per_coded_sample, buf, buf_size); ff_msrle_decode(avctx, (AVPicture*)&s->frame, avctx->bits_per_coded_sample, buf, buf_size);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment