1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

msrle: fix regression causing null ptr dereference

Fixes Ticket1630

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2012-08-11 02:20:06 +02:00
parent f9505923a3
commit 58825a18aa

View File

@ -106,11 +106,10 @@ static int msrle_decode_frame(AVCodecContext *avctx,
s->frame.palette_has_changed = 1; s->frame.palette_has_changed = 1;
memcpy(s->pal, pal, AVPALETTE_SIZE); memcpy(s->pal, pal, AVPALETTE_SIZE);
} }
/* make the palette available */
memcpy(s->frame.data[1], s->pal, AVPALETTE_SIZE);
} }
/* make the palette available */
memcpy(s->frame.data[1], s->pal, AVPALETTE_SIZE);
/* FIXME how to correctly detect RLE ??? */ /* FIXME how to correctly detect RLE ??? */
if (avctx->height * istride == avpkt->size) { /* assume uncompressed */ if (avctx->height * istride == avpkt->size) { /* assume uncompressed */
int linesize = (avctx->width * avctx->bits_per_coded_sample + 7) / 8; int linesize = (avctx->width * avctx->bits_per_coded_sample + 7) / 8;