diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-11-15 16:41:28 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-11-15 16:46:51 +0100 |
commit | c0d68be555f5858703383040e04fcd6529777061 (patch) | |
tree | 8ed6dfb5d04ddaacda587a4b7703517641959ef7 /libavcodec/pgssubdec.c | |
parent | bc08ca841e66134a3b0d900cf152b4a263fa6545 (diff) | |
download | ffmpeg-c0d68be555f5858703383040e04fcd6529777061.tar.gz |
pgssubdec: check RLE size before copying. Fix out of array accesses
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/pgssubdec.c')
-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 2876c6ac32..a303c08b80 100644 --- a/libavcodec/pgssubdec.c +++ b/libavcodec/pgssubdec.c @@ -222,6 +222,11 @@ static int parse_picture_segment(AVCodecContext *avctx, return -1; } + if (buf_size > rle_bitmap_len) { + av_log(avctx, AV_LOG_ERROR, "too much RLE data\n"); + return AVERROR_INVALIDDATA; + } + ctx->pictures[picture_id].w = width; ctx->pictures[picture_id].h = height; |