[FFmpeg-cvslog] avcodec/bink: Fix off by 1 error in ref end
Michael Niedermayer
git at videolan.org
Thu Mar 16 15:50:42 EET 2023
ffmpeg | branch: release/5.1 | Michael Niedermayer <michael at niedermayer.cc> | Wed Jan 11 20:42:23 2023 +0100| [2d6c2b6dc200aa5627aa22c2e36fd5e90e44a094] | committer: Michael Niedermayer
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 at niedermayer.cc>
(cherry picked from commit 49487045dde6f69194332aac51fd4e598e19c7b6)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=2d6c2b6dc200aa5627aa22c2e36fd5e90e44a094
---
libavcodec/bink.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libavcodec/bink.c b/libavcodec/bink.c
index 3ba3068e0b..5a261e4a2d 100644
--- a/libavcodec/bink.c
+++ b/libavcodec/bink.c
@@ -871,7 +871,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;
More information about the ffmpeg-cvslog
mailing list