aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-08-20 23:18:48 +0200
committerMichael Niedermayer <michaelni@gmx.at>2013-08-29 01:29:35 +0200
commit65753697efdb9e4dd61f4ba582bd04476acdc69a (patch)
tree1d323e0ed724ad02c24369aa02db291addcf5e90
parent278fbfc6bf3a501eb0af5ce07a528785ce8715a7 (diff)
downloadffmpeg-65753697efdb9e4dd61f4ba582bd04476acdc69a.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.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavcodec/flashsv.c b/libavcodec/flashsv.c
index 1d94efdb83..db956cb5bd 100644
--- a/libavcodec/flashsv.c
+++ b/libavcodec/flashsv.c
@@ -373,6 +373,10 @@ static int flashsv_decode_frame(AVCodecContext *avctx, void *data,
if (has_diff) {
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);