From 5d94bb4fccb8da060ae342a60c949d03d975d697 Mon Sep 17 00:00:00 2001 From: Lucas CHOLLET Date: Mon, 17 Jul 2023 00:57:29 -0400 Subject: [PATCH] LibGfx/PNG: Remove the useless `HeaderDecoded` state --- Userland/Libraries/LibGfx/ImageFormats/PNGLoader.cpp | 5 ----- 1 file changed, 5 deletions(-) diff --git a/Userland/Libraries/LibGfx/ImageFormats/PNGLoader.cpp b/Userland/Libraries/LibGfx/ImageFormats/PNGLoader.cpp index 07bc7df07d..a17b00809a 100644 --- a/Userland/Libraries/LibGfx/ImageFormats/PNGLoader.cpp +++ b/Userland/Libraries/LibGfx/ImageFormats/PNGLoader.cpp @@ -156,7 +156,6 @@ struct PNGLoadingContext { enum State { NotDecoded = 0, Error, - HeaderDecoded, IHDRDecoded, ImageDataChunkDecoded, ChunksDecoded, @@ -589,9 +588,6 @@ NEVER_INLINE FLATTEN static ErrorOr unfilter(PNGLoadingContext& context) static bool decode_png_header(PNGLoadingContext& context) { - if (context.state >= PNGLoadingContext::HeaderDecoded) - return true; - if (!context.data || context.data_size < sizeof(PNG::header)) { dbgln_if(PNG_DEBUG, "Missing PNG header"); context.state = PNGLoadingContext::State::Error; @@ -605,7 +601,6 @@ static bool decode_png_header(PNGLoadingContext& context) } context.data_current_ptr = context.data + sizeof(PNG::header); - context.state = PNGLoadingContext::HeaderDecoded; return true; }