summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2023-01-11 20:42:23 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2023-04-15 22:38:07 +0200
commitbc8b9111d385b26f18750c0dc79274a6bf0dbc66 (patch)
tree2ef7ed6e8c1917f9c5241d17f7d21106fcaec766
parent7b5c345525933c7d273053b7084f385f0b8dd352 (diff)
downloadffmpeg-bc8b9111d385b26f18750c0dc79274a6bf0dbc66.tar.gz
avcodec/bink: Fix off by 1 error in ref end
Fixes: out of array access Fixes: 48567/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_BINK_fuzzer-6657932926517248 Alterantivly to this it is possibly to allocate a bigger array Note: oss-fuzz assigned this issue to a unrelated theora bug so the bug number matches that Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit 49487045dde6f69194332aac51fd4e598e19c7b6) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/bink.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/bink.c b/libavcodec/bink.c
index 7da04f0336..c61f76cf95 100644
--- a/libavcodec/bink.c
+++ b/libavcodec/bink.c
@@ -867,7 +867,7 @@ static int binkb_decode_plane(BinkContext *c, AVFrame *frame, GetBitContext *gb,
binkb_init_bundles(c);
ref_start = frame->data[plane_idx];
- ref_end = frame->data[plane_idx] + (bh * frame->linesize[plane_idx] + bw) * 8;
+ ref_end = frame->data[plane_idx] + (bh * frame->linesize[plane_idx] + bw - 1) * 8;
for (i = 0; i < 64; i++)
coordmap[i] = (i & 7) + (i >> 3) * stride;