diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-08-20 23:18:48 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-09-27 00:18:12 +0200 |
commit | e288124394840f9e37e110afe47c737044372f89 (patch) | |
tree | bcdff1d356a9423bb8a4227d9e787f149c8cb82d | |
parent | 20854f9bffd2130b6b987c439c2b4002aa177dd0 (diff) | |
download | ffmpeg-e288124394840f9e37e110afe47c737044372f89.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 b7ace4f884..7ef4ade58e 100644 --- a/libavcodec/flashsv.c +++ b/libavcodec/flashsv.c @@ -388,6 +388,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); |