diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-08-20 23:18:48 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-08-28 13:39:26 +0200 |
commit | f508bf7ff1f86d876dc6da43002d2240d4157bf1 (patch) | |
tree | b80cf0c71de0cbcf476aab0a9ee324ab565904e1 | |
parent | 898c51a01608ba30e21abbe16d9243ee264be660 (diff) | |
download | ffmpeg-f508bf7ff1f86d876dc6da43002d2240d4157bf1.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>
-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 7855416567..9e271e1f75 100644 --- a/libavcodec/flashsv.c +++ b/libavcodec/flashsv.c @@ -389,6 +389,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); |