From 835d328a6c96c1d3132a176a932b1dccb5918f9d Mon Sep 17 00:00:00 2001 From: Nico Weber Date: Fri, 5 May 2023 14:27:16 -0400 Subject: [PATCH] LibGfx/WebP: Check presence of ANMF chunks correctly Previously, we looked at the wrong variable here. --- Userland/Libraries/LibGfx/ImageFormats/WebPLoader.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Userland/Libraries/LibGfx/ImageFormats/WebPLoader.cpp b/Userland/Libraries/LibGfx/ImageFormats/WebPLoader.cpp index 26950c116a..4ebcd2439a 100644 --- a/Userland/Libraries/LibGfx/ImageFormats/WebPLoader.cpp +++ b/Userland/Libraries/LibGfx/ImageFormats/WebPLoader.cpp @@ -1372,7 +1372,7 @@ static ErrorOr decode_webp_extended(WebPLoadingContext& context, ReadonlyB } // "ANMF Chunk: [...] If the Animation flag is not set, then this chunk SHOULD NOT be present." - if (!context.vp8x_header.has_animation && context.animation_header_chunk.has_value()) { + if (!context.vp8x_header.has_animation && !context.animation_frame_chunks.is_empty()) { dbgln_if(WEBP_DEBUG, "WebPImageDecoderPlugin: Header claims no animation, but ANMF chunks present. Ignoring ANMF chunks."); context.animation_frame_chunks.clear(); }