From 6b133d7e9c767c7d0bc39f2b301afd17c491c178 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Reimar=20D=C3=B6ffinger?= Date: Mon, 22 Nov 2010 20:39:18 +0000 Subject: Fail RLE decoding if insufficient data for a complete bitmap was decoded. Originally committed as revision 25797 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavcodec/pgssubdec.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libavcodec/pgssubdec.c b/libavcodec/pgssubdec.c index 197582f..c283b9c 100644 --- a/libavcodec/pgssubdec.c +++ b/libavcodec/pgssubdec.c @@ -136,6 +136,11 @@ static int decode_rle(AVCodecContext *avctx, AVSubtitle *sub, } } + if (pixel_count < sub->rects[0]->w * sub->rects[0]->h) { + av_log(avctx, AV_LOG_ERROR, "Insufficient RLE data for subtitle\n"); + return -1; + } + dprintf(avctx, "Pixel Count = %d, Area = %d\n", pixel_count, sub->rects[0]->w * sub->rects[0]->h); return 0; -- cgit v1.1