From 5ace144fe0b7519c389d3ddcdcf7082b4e89b0df Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Wed, 9 Nov 2011 19:40:59 +0100 Subject: fraps: check for overread. Signed-off-by: Anton Khirnov --- libavcodec/fraps.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'libavcodec/fraps.c') diff --git a/libavcodec/fraps.c b/libavcodec/fraps.c index ed33c3eabf..1444eda979 100644 --- a/libavcodec/fraps.c +++ b/libavcodec/fraps.c @@ -111,6 +111,10 @@ static int fraps2_decode_plane(FrapsContext *s, uint8_t *dst, int stride, int w, */ if(j) dst[i] += dst[i - stride]; else if(Uoff) dst[i] += 0x80; + if (get_bits_left(&gb) < 0) { + free_vlc(&vlc); + return AVERROR_INVALIDDATA; + } } dst += stride; } -- cgit v1.2.1