aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2021-07-31 12:41:34 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2021-09-08 21:31:50 +0200
commit725a0446b409d20a8fb762e5804b170808a52001 (patch)
treeafa4e8a871df96353121b37530cda6f03ed58623
parent88264f84c99519651a7417f4eed25ae17a6e61d1 (diff)
downloadffmpeg-725a0446b409d20a8fb762e5804b170808a52001.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> (cherry picked from commit c2f5e9ff3c8141fe6a2c08f3cc4e46e17b96cbb4) 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 7358d102e3..7074561956 100644
--- a/libavcodec/argo.c
+++ b/libavcodec/argo.c
@@ -685,6 +685,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);