From 07446bbea1975449a73a5bcc907307255fccfe71 Mon Sep 17 00:00:00 2001 From: Lucas CHOLLET Date: Tue, 21 May 2024 20:59:42 -0400 Subject: [PATCH] LibGfx/GIF: Use the correct reference to seek before the trailer This was working with files, but with pre-allocated buffers, the end is not the same position as last written byte. --- Userland/Libraries/LibGfx/ImageFormats/GIFWriter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Userland/Libraries/LibGfx/ImageFormats/GIFWriter.cpp b/Userland/Libraries/LibGfx/ImageFormats/GIFWriter.cpp index 71c5d2d91c2..a50e04669da 100644 --- a/Userland/Libraries/LibGfx/ImageFormats/GIFWriter.cpp +++ b/Userland/Libraries/LibGfx/ImageFormats/GIFWriter.cpp @@ -182,7 +182,7 @@ ErrorOr GIFAnimationWriter::add_frame(Bitmap& bitmap, int duration_ms, Int // Let's get rid of the previously written trailer if (!m_is_first_frame) - TRY(m_stream.seek(-1, SeekMode::FromEndPosition)); + TRY(m_stream.seek(-1, SeekMode::FromCurrentPosition)); m_is_first_frame = false;