diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-08-20 23:18:48 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-08-25 19:50:54 +0200 |
commit | 64d440a3b459bf9747cbd134afd29e4463a52c44 (patch) | |
tree | ed4419affdbca484e386d179a579ef3bcb792140 /libavcodec | |
parent | 42586c875418ff93689536dc5a6db80f80a747e3 (diff) | |
download | ffmpeg-64d440a3b459bf9747cbd134afd29e4463a52c44.tar.gz |
avcodec/flashsv: check diff_start/height
Fixes out of array accesses
Fixes Ticket2844
Found-by: ami_stuff
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 880c73cd76109697447fbfbaa8e5ee5683309446)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/flashsv.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libavcodec/flashsv.c b/libavcodec/flashsv.c index 21464ed6b4..4d13a5d830 100644 --- a/libavcodec/flashsv.c +++ b/libavcodec/flashsv.c @@ -394,6 +394,10 @@ static int flashsv_decode_frame(AVCodecContext *avctx, void *data, } s->diff_start = get_bits(&gb, 8); s->diff_height = get_bits(&gb, 8); + if (s->diff_start + s->diff_height > cur_blk_height) { + av_log(avctx, AV_LOG_ERROR, "Block parameters invalid\n"); + return AVERROR_INVALIDDATA; + } av_log(avctx, AV_LOG_DEBUG, "%dx%d diff start %d height %d\n", i, j, s->diff_start, s->diff_height); |