diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-01-04 16:37:20 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-01-04 17:06:29 +0100 |
commit | c98d3056cf0235340cf2918fc73151a6db5b4fb3 (patch) | |
tree | 173f1360e5e104ebd06257564bae1a566f6bcd15 /libavcodec/msrle.c | |
parent | ac25b31ede03ef4f89175cb3c293ff6b5609e6c2 (diff) | |
download | ffmpeg-c98d3056cf0235340cf2918fc73151a6db5b4fb3.tar.gz |
msrle: fix small palette handling
Fixes second file in Ticket1273
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/msrle.c')
-rw-r--r-- | libavcodec/msrle.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/msrle.c b/libavcodec/msrle.c index a1ef037e49..5b7ba7fdad 100644 --- a/libavcodec/msrle.c +++ b/libavcodec/msrle.c @@ -73,8 +73,8 @@ static av_cold int msrle_decode_init(AVCodecContext *avctx) avcodec_get_frame_defaults(&s->frame); s->frame.data[0] = NULL; - if (avctx->extradata_size >= AVPALETTE_SIZE) - for (i = 0; i < AVPALETTE_SIZE/4; i++) + if (avctx->extradata_size >= 4) + for (i = 0; i < FFMIN(avctx->extradata_size, AVPALETTE_SIZE)/4; i++) s->pal[i] = 0xFFU<<24 | AV_RL32(avctx->extradata+4*i); return 0; |