Commit 456f0c64 authored by Michael Niedermayer's avatar Michael Niedermayer

pafdec: fix wrong palette index check.

Fixes Ticket1641
Found-by: 's avatarPiotr Bandurski <ami_stuff@o2.pl>
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 02f12de1
...@@ -276,7 +276,7 @@ static int paf_vid_decode(AVCodecContext *avctx, void *data, ...@@ -276,7 +276,7 @@ static int paf_vid_decode(AVCodecContext *avctx, void *data,
index = bytestream2_get_byte(&c->gb); index = bytestream2_get_byte(&c->gb);
count = bytestream2_get_byte(&c->gb) + 1; count = bytestream2_get_byte(&c->gb) + 1;
if (index + count > AVPALETTE_SIZE) if (index + count > 256)
return AVERROR_INVALIDDATA; return AVERROR_INVALIDDATA;
if (bytestream2_get_bytes_left(&c->gb) < 3 * AVPALETTE_SIZE) if (bytestream2_get_bytes_left(&c->gb) < 3 * AVPALETTE_SIZE)
return AVERROR_INVALIDDATA; return AVERROR_INVALIDDATA;
......
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