[FFmpeg-cvslog] msrle: fix small palette handling
Michael Niedermayer
git at videolan.org
Fri Jan 4 17:31:47 CET 2013
ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Fri Jan 4 16:37:20 2013 +0100| [c98d3056cf0235340cf2918fc73151a6db5b4fb3] | committer: Michael Niedermayer
msrle: fix small palette handling
Fixes second file in Ticket1273
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c98d3056cf0235340cf2918fc73151a6db5b4fb3
---
libavcodec/msrle.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/libavcodec/msrle.c b/libavcodec/msrle.c
index a1ef037..5b7ba7f 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;
More information about the ffmpeg-cvslog
mailing list