diff --git a/libavcodec/webp.c b/libavcodec/webp.c index ead8ef5217..635dd4e3a2 100644 --- a/libavcodec/webp.c +++ b/libavcodec/webp.c @@ -738,6 +738,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 */