diff --git a/Userland/Libraries/LibGfx/ImageFormats/GIFLoader.cpp b/Userland/Libraries/LibGfx/ImageFormats/GIFLoader.cpp index 165755630f..f110b1fb57 100644 --- a/Userland/Libraries/LibGfx/ImageFormats/GIFLoader.cpp +++ b/Userland/Libraries/LibGfx/ImageFormats/GIFLoader.cpp @@ -381,7 +381,7 @@ static ErrorOr decode_frame(GIFLoadingContext& context, size_t frame_index return {}; } -static ErrorOr load_gif_frame_descriptors(GIFLoadingContext& context) +static ErrorOr load_header_and_logical_screen(GIFLoadingContext& context) { if (TRY(context.stream.size()) < 32) return Error::from_string_literal("Size too short for GIF frame descriptors"); @@ -412,6 +412,13 @@ static ErrorOr load_gif_frame_descriptors(GIFLoadingContext& context) context.logical_screen.color_map[i] = { r, g, b }; } + return {}; +} + +static ErrorOr load_gif_frame_descriptors(GIFLoadingContext& context) +{ + TRY(load_header_and_logical_screen(context)); + NonnullOwnPtr current_image = make(); for (;;) { u8 sentinel = TRY(context.stream.read_value());