Skip to content

Commit 880c73c

Browse files
committed
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>
1 parent 78d2a78 commit 880c73c

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Diff for: libavcodec/flashsv.c

+4
Original file line numberDiff line numberDiff line change
@@ -387,6 +387,10 @@ static int flashsv_decode_frame(AVCodecContext *avctx, void *data,
387387
}
388388
s->diff_start = get_bits(&gb, 8);
389389
s->diff_height = get_bits(&gb, 8);
390+
if (s->diff_start + s->diff_height > cur_blk_height) {
391+
av_log(avctx, AV_LOG_ERROR, "Block parameters invalid\n");
392+
return AVERROR_INVALIDDATA;
393+
}
390394
av_log(avctx, AV_LOG_DEBUG,
391395
"%dx%d diff start %d height %d\n",
392396
i, j, s->diff_start, s->diff_height);

0 commit comments

Comments
 (0)