diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-08-20 23:18:48 +0200 |
---|---|---|
committer | Reinhard Tartler <siretart@tauware.de> | 2014-02-01 14:06:24 -0500 |
commit | cb5d0ea0bec119ecbe327bd7d3834987ab42ec1a (patch) | |
tree | 3016afb959ecea9bfcdd36ce51c8047ef88a0447 /libavcodec | |
parent | ef6c90e102a393c136a38c1eee42bfd26e964de5 (diff) | |
download | ffmpeg-cb5d0ea0bec119ecbe327bd7d3834987ab42ec1a.tar.gz |
flashsv: Check diff_start diff_height values
Fix out of array accesses.
Found-by: ami_stuff
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Adresses: CVE-2013-7015
(cherry picked from commit 57070b1468edc6ac8cb3696c817f3c943975d4c1)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
(cherry picked from commit 10d48fe6d3963842319b1d8d738a318020836e72)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
Diffstat (limited to 'libavcodec')
-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 4a231ce899..686a696099 100644 --- a/libavcodec/flashsv.c +++ b/libavcodec/flashsv.c @@ -377,6 +377,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); |