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 <michael@niedermayer.cc>
(cherry picked from commit 7c1e732ad2)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
release/7.1
Michael Niedermayer 6 months ago
parent 886dd058fe
commit bc8248d07a
No known key found for this signature in database
GPG Key ID: B18E8928B3948D64
  1. 3
      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_x = FFMAX(0, ref_x);
ref_y = FFMAX(0, ref_y); ref_y = FFMAX(0, ref_y);
if (ref_y == y && ref_x >= x)
return AVERROR_INVALIDDATA;
/* copy pixels /* copy pixels
* source and dest regions can overlap and wrap lines, so just * source and dest regions can overlap and wrap lines, so just
* copy per-pixel */ * copy per-pixel */

Loading…
Cancel
Save