diff --git a/Userland/Libraries/LibGfx/ImageFormats/WebPWriter.cpp b/Userland/Libraries/LibGfx/ImageFormats/WebPWriter.cpp index 0c81ecdd435..5d01b459197 100644 --- a/Userland/Libraries/LibGfx/ImageFormats/WebPWriter.cpp +++ b/Userland/Libraries/LibGfx/ImageFormats/WebPWriter.cpp @@ -352,6 +352,12 @@ ErrorOr WebPAnimationWriter::set_alpha_bit_in_header() m_vp8x_flags |= 0x10; auto current_offset = TRY(m_stream.tell()); + // 4 bytes for "RIFF", + // 4 bytes RIFF chunk size (i.e. file size - 8), + // 4 bytes for "WEBP", + // 4 bytes for "VP8X", + // 4 bytes for VP8X chunk size, + // followed by VP8X flags in the first byte of the VP8X chunk data. TRY(m_stream.seek(20, SeekMode::SetPosition)); TRY(m_stream.write_value(m_vp8x_flags)); TRY(m_stream.seek(current_offset, SeekMode::SetPosition));