From 8a0f1d87c0835bc02e38e9eb87dcaf585831887b Mon Sep 17 00:00:00 2001 From: Idan Horowitz Date: Wed, 7 Apr 2021 17:23:36 +0300 Subject: [PATCH] LibGfx: Fix IHDR filter method field validation As per the PNG specification: "Filter method is a single-byte integer that indicates the preprocessing method applied to the image data before compression. At present, only filter method 0 (adaptive filtering with five basic filter types) is defined." --- Userland/Libraries/LibGfx/PNGLoader.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Userland/Libraries/LibGfx/PNGLoader.cpp b/Userland/Libraries/LibGfx/PNGLoader.cpp index 21e9ad99cf..2260ea4d17 100644 --- a/Userland/Libraries/LibGfx/PNGLoader.cpp +++ b/Userland/Libraries/LibGfx/PNGLoader.cpp @@ -829,7 +829,7 @@ static bool is_valid_compression_method(u8 compression_method) static bool is_valid_filter_method(u8 filter_method) { - return filter_method <= 4; + return filter_method == 0; } static bool process_IHDR(ReadonlyBytes data, PNGLoadingContext& context)