summaryrefslogtreecommitdiff
path: root/libavcodec/bink.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2022-06-13 02:01:20 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2022-09-02 10:44:28 +0200
commitb14104a6376cd774b08cbe5fda56b34320a41b2e (patch)
treefc00ff287b3db2115c33ec4e3a9982622f893b38 /libavcodec/bink.c
parentff6044b921ffb59964a126faef5106a391a819eb (diff)
downloadffmpeg-b14104a6376cd774b08cbe5fda56b34320a41b2e.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>
Diffstat (limited to 'libavcodec/bink.c')
-rw-r--r--libavcodec/bink.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/bink.c b/libavcodec/bink.c
index a3cd4667d6..c1960484d6 100644
--- a/libavcodec/bink.c
+++ b/libavcodec/bink.c
@@ -1087,7 +1087,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;