diff options
author | Reimar Döffinger <Reimar.Doeffinger@gmx.de> | 2010-11-22 20:39:18 +0000 |
---|---|---|
committer | Reimar Döffinger <Reimar.Doeffinger@gmx.de> | 2010-11-22 20:39:18 +0000 |
commit | 6b133d7e9c767c7d0bc39f2b301afd17c491c178 (patch) | |
tree | 0d78d73d22acf5a37c0f9676e7a7aa5f2d01f47e | |
parent | 83cd91122a8d8e4a13bddc82b74054a0978be24f (diff) | |
download | ffmpeg-6b133d7e9c767c7d0bc39f2b301afd17c491c178.tar.gz |
Fail RLE decoding if insufficient data for a complete bitmap was decoded.
Originally committed as revision 25797 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r-- | libavcodec/pgssubdec.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/pgssubdec.c b/libavcodec/pgssubdec.c index 197582f285..c283b9c0c3 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; |