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."
This commit is contained in:
Idan Horowitz 2021-04-07 17:23:36 +03:00 committed by Andreas Kling
commit 8a0f1d87c0
Notes: sideshowbarker 2024-07-18 20:39:32 +09:00

View file

@ -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)