[FFmpeg-cvslog] avcodec/bink: disallow odd positioned scaled blocks

Michael Niedermayer git at videolan.org
Mon Oct 10 16:57:00 EEST 2022


ffmpeg | branch: release/4.1 | Michael Niedermayer <michael at niedermayer.cc> | Mon Jun 13 02:01:20 2022 +0200| [b2222721245cfbba2d3f6917f0ab316aaeb76db3] | committer: Michael Niedermayer

avcodec/bink: disallow odd positioned scaled blocks

Fixes: out of array access
Fixes: 47911/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_BINK_fuzzer-6194020855971840

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Anton Khirnov <anton at khirnov.net>
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
(cherry picked from commit b14104a6376cd774b08cbe5fda56b34320a41b2e)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=b2222721245cfbba2d3f6917f0ab316aaeb76db3
---

 libavcodec/bink.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/bink.c b/libavcodec/bink.c
index ca10a0ce81..bc4fe7e163 100644
--- a/libavcodec/bink.c
+++ b/libavcodec/bink.c
@@ -1054,7 +1054,7 @@ static int bink_decode_plane(BinkContext *c, AVFrame *frame, GetBitContext *gb,
         for (bx = 0; bx < bw; bx++, dst += 8, prev += 8) {
             blk = get_value(c, BINK_SRC_BLOCK_TYPES);
             // 16x16 block type on odd line means part of the already decoded block, so skip it
-            if ((by & 1) && blk == SCALED_BLOCK) {
+            if (((by & 1) || (bx & 1)) && blk == SCALED_BLOCK) {
                 bx++;
                 dst  += 8;
                 prev += 8;



More information about the ffmpeg-cvslog mailing list