diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2022-06-13 02:01:20 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2022-10-09 21:33:03 +0200 |
commit | 9909b41f92e754c10e7835977027ceac554a4081 (patch) | |
tree | 51a957e84e7ed00b7ceca0809825e7d6c0a20bed | |
parent | 48b8139b95078c88ab580968462a81207126ec3c (diff) | |
download | ffmpeg-9909b41f92e754c10e7835977027ceac554a4081.tar.gz |
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@khirnov.net>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit b14104a6376cd774b08cbe5fda56b34320a41b2e)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavcodec/bink.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/bink.c b/libavcodec/bink.c index d18c0ceae4..5834b4e465 100644 --- a/libavcodec/bink.c +++ b/libavcodec/bink.c @@ -1052,7 +1052,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; |