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.
This commit is contained in:
Lucas CHOLLET 2024-05-21 20:59:42 -04:00 committed by Tim Flynn
commit 07446bbea1
Notes: sideshowbarker 2024-07-17 06:54:15 +09:00

View file

@ -182,7 +182,7 @@ ErrorOr<void> GIFAnimationWriter::add_frame(Bitmap& bitmap, int duration_ms, Int
// Let's get rid of the previously written trailer // Let's get rid of the previously written trailer
if (!m_is_first_frame) if (!m_is_first_frame)
TRY(m_stream.seek(-1, SeekMode::FromEndPosition)); TRY(m_stream.seek(-1, SeekMode::FromCurrentPosition));
m_is_first_frame = false; m_is_first_frame = false;