Browse Source

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

Originally committed as revision 18785 to svn://svn.ffmpeg.org/ffmpeg/trunk
tags/v0.6
Baptiste Coudurier 17 years ago
parent
commit
a7e562291d
1 changed files with 2 additions and 0 deletions
  1. +2
    -0
      libavcodec/msrle.c

+ 2
- 0
libavcodec/msrle.c View 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);



Loading…
Cancel
Save