diff mbox series

[FFmpeg-devel,3/9] avcodec/webp: Check ref_x/y

Message ID 20240816231157.3166012-3-michael@niedermayer.cc
State New
Headers show
Series [FFmpeg-devel,1/9] avformat/rmdec: check that bug if completely filled | expand

Commit Message

Michael Niedermayer Aug. 16, 2024, 11:11 p.m. UTC
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 <michael@niedermayer.cc>
---
 libavcodec/webp.c | 3 +++
 1 file changed, 3 insertions(+)
diff mbox series

Patch

diff --git a/libavcodec/webp.c b/libavcodec/webp.c
index 7c2a5f0111f..b624458d675 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 */