1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

Fail RLE decoding if insufficient data for a complete bitmap was decoded.

Originally committed as revision 25797 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
Reimar Döffinger 2010-11-22 20:39:18 +00:00
parent 83cd91122a
commit 6b133d7e9c

View File

@ -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); dprintf(avctx, "Pixel Count = %d, Area = %d\n", pixel_count, sub->rects[0]->w * sub->rects[0]->h);
return 0; return 0;