From 456f0c6477925611f1b45a434795f8bad4fb2a66 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Wed, 15 Aug 2012 01:57:45 +0200 Subject: pafdec: fix wrong palette index check. Fixes Ticket1641 Found-by: Piotr Bandurski Signed-off-by: Michael Niedermayer --- libavcodec/paf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libavcodec') diff --git a/libavcodec/paf.c b/libavcodec/paf.c index 1c3e8b8fcd..388e2a082c 100644 --- a/libavcodec/paf.c +++ b/libavcodec/paf.c @@ -276,7 +276,7 @@ static int paf_vid_decode(AVCodecContext *avctx, void *data, index = bytestream2_get_byte(&c->gb); count = bytestream2_get_byte(&c->gb) + 1; - if (index + count > AVPALETTE_SIZE) + if (index + count > 256) return AVERROR_INVALIDDATA; if (bytestream2_get_bytes_left(&c->gb) < 3 * AVPALETTE_SIZE) return AVERROR_INVALIDDATA; -- cgit v1.2.3