diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-08-20 23:18:48 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-08-20 23:18:48 +0200 |
commit | 880c73cd76109697447fbfbaa8e5ee5683309446 (patch) | |
tree | 5f07d169e7773b5d32e3c1c69a701b6ae2dc3902 /libavcodec/flashsv.c | |
parent | 78d2a781d092c4b678e06de147a666ad65e184de (diff) | |
download | ffmpeg-880c73cd76109697447fbfbaa8e5ee5683309446.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>
Diffstat (limited to 'libavcodec/flashsv.c')
-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 9982b5e966..f00bf21d47 100644 --- a/libavcodec/flashsv.c +++ b/libavcodec/flashsv.c @@ -387,6 +387,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); |