aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2021-07-31 12:41:34 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2021-08-10 18:05:13 +0200
commitc2f5e9ff3c8141fe6a2c08f3cc4e46e17b96cbb4 (patch)
treec143b04d700a9779f3934dadff17e4349193533d
parent2063745a93f3a17ee14ffd01905878b8fdc17023 (diff)
downloadffmpeg-c2f5e9ff3c8141fe6a2c08f3cc4e46e17b96cbb4.tar.gz
avcodec/argo: Check for even dimensions
Fixes: reading over the end Fixes: 36346/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ARGO_fuzzer-5366943107383296 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/argo.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/argo.c b/libavcodec/argo.c
index bbdb6ae15f..df9aab92a8 100644
--- a/libavcodec/argo.c
+++ b/libavcodec/argo.c
@@ -684,6 +684,11 @@ static av_cold int decode_init(AVCodecContext *avctx)
return AVERROR_PATCHWELCOME;
}
+ if (avctx->width % 2 || avctx->height % 2) {
+ avpriv_request_sample(s, "Odd dimensions\n");
+ return AVERROR_PATCHWELCOME;
+ }
+
s->frame = av_frame_alloc();
if (!s->frame)
return AVERROR(ENOMEM);