summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <[email protected]>2024-08-16 16:00:01 +0200
committerMichael Niedermayer <[email protected]>2024-12-04 04:23:49 +0100
commit7c1e732ad2e240af5afe9ffea443c91bb233aa65 (patch)
treed9efd2842280dc8dcfed3b8d348c804a98bed8b9
parent4482218440534804d067de00ee1a4bc493c8b41d (diff)
avcodec/webp: Check ref_x/y
Fixes: 70991/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WEBP_fuzzer-5544067620995072 Fixes: use of uninintailized value Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <[email protected]>
-rw-r--r--libavcodec/webp.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavcodec/webp.c b/libavcodec/webp.c
index 7c2a5f0111..b624458d67 100644
--- a/libavcodec/webp.c
+++ b/libavcodec/webp.c
@@ -704,6 +704,9 @@ static int decode_entropy_coded_image(WebPContext *s, enum ImageRole role,
ref_x = FFMAX(0, ref_x);
ref_y = FFMAX(0, ref_y);
+ if (ref_y == y && ref_x >= x)
+ return AVERROR_INVALIDDATA;
+
/* copy pixels
* source and dest regions can overlap and wrap lines, so just
* copy per-pixel */