summaryrefslogtreecommitdiff
path: root/Userland/Libraries
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2021-02-07 01:17:51 +0100
committerAndreas Kling <kling@serenityos.org>2021-02-07 01:21:42 +0100
commit57e10eadac01273cc4c0bcb681aa9381cacef0b3 (patch)
treeda920120e3f976bfb14f8fb60eb310ff78bab179 /Userland/Libraries
parentdff808d087bf8c9c7596aa14fb6cffd0a5846072 (diff)
downloadserenity-57e10eadac01273cc4c0bcb681aa9381cacef0b3.zip
LibGfx: Don't reject valid GIF animations with interlaced frames
We were returning early from the deinterlacing loop after the very last pass, but we should just let the outer loop finish and return instead. This makes the Netscape animation on https://timmorgan.dev work. :^)
Diffstat (limited to 'Userland/Libraries')
-rw-r--r--Userland/Libraries/LibGfx/GIFLoader.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/Userland/Libraries/LibGfx/GIFLoader.cpp b/Userland/Libraries/LibGfx/GIFLoader.cpp
index 12d9eebba5..4e69cc7fb5 100644
--- a/Userland/Libraries/LibGfx/GIFLoader.cpp
+++ b/Userland/Libraries/LibGfx/GIFLoader.cpp
@@ -401,10 +401,8 @@ static bool decode_frame(GIFLoadingContext& context, size_t frame_index)
if (image.interlaced) {
if (row + INTERLACE_ROW_STRIDES[interlace_pass] >= image.height) {
++interlace_pass;
- // FIXME: We could probably figure this out earlier and fail before doing a bunch of work.
- if (interlace_pass >= 4)
- return false;
- row = INTERLACE_ROW_OFFSETS[interlace_pass];
+ if (interlace_pass < 4)
+ row = INTERLACE_ROW_OFFSETS[interlace_pass];
} else {
row += INTERLACE_ROW_STRIDES[interlace_pass];
}