diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-08-21 01:18:48 +0400 |
---|---|---|
committer | Luca Barbato <lu_zero@gentoo.org> | 2013-11-01 22:38:53 +0400 |
commit | 57070b1468edc6ac8cb3696c817f3c943975d4c1 (patch) | |
tree | e5d622118b3115adc00d1c990e07f904fd96fe0a | |
parent | 4a64e67988dd01005efb1ae831bff14c1656b573 (diff) |
flashsv: Check diff_start diff_height values
Fix out of array accesses.
Found-by: ami_stuff
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavcodec/flashsv.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/libavcodec/flashsv.c b/libavcodec/flashsv.c index f0a8036a25..a237aa76b8 100644 --- a/libavcodec/flashsv.c +++ b/libavcodec/flashsv.c @@ -383,6 +383,12 @@ 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: %d + %d > %d\n", + s->diff_start, s->diff_height, cur_blk_height); + 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); |