aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2022-11-23 21:27:13 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2022-12-08 17:48:21 +0100
commita9d15d43eb0f976b982bf2ad6ec1d8ac084c7ded (patch)
treefefaa7bc35238f91eb6b507d30f8154e792b5c24
parent2401494e96446c7f9cedf73cee548932db0a6e2a (diff)
downloadffmpeg-a9d15d43eb0f976b982bf2ad6ec1d8ac084c7ded.tar.gz
avcodec/vqcdec: Check width & 15
Various parts of the code assume that width can be divided by various powers of 2 without rounding Fixes: out of array access Fixes: 53623/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VQC_fuzzer-6209269924233216 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Reviewed-by: Peter Ross <pross@xvid.org> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/vqcdec.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavcodec/vqcdec.c b/libavcodec/vqcdec.c
index 18cd99462e..c3bce87974 100644
--- a/libavcodec/vqcdec.c
+++ b/libavcodec/vqcdec.c
@@ -71,6 +71,9 @@ static av_cold int vqc_decode_init(AVCodecContext * avctx)
static AVOnce init_static_once = AV_ONCE_INIT;
VqcContext *s = avctx->priv_data;
+ if (avctx->width & 15)
+ return AVERROR_PATCHWELCOME;
+
s->vectors = av_malloc((avctx->width * avctx->height * 3) / 2);
if (!s->vectors)
return AVERROR(ENOMEM);