1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 21:27:35 +00:00

LibGfx: Allow passing FilterType::None to unfilter_scanline()

Makes calling this in LibPDF less awkward, and there's no reason
not to allow this.
This commit is contained in:
Nico Weber 2023-11-16 20:07:27 -05:00 committed by Andreas Kling
parent 574357ef00
commit 000d9da73c

View file

@ -291,9 +291,9 @@ static_assert(AssertSize<Pixel, 4>());
void PNGImageDecoderPlugin::unfilter_scanline(PNG::FilterType filter, Bytes scanline_data, ReadonlyBytes previous_scanlines_data, u8 bytes_per_complete_pixel)
{
VERIFY(filter != PNG::FilterType::None);
switch (filter) {
case PNG::FilterType::None:
break;
case PNG::FilterType::Sub:
// This loop starts at bytes_per_complete_pixel because all bytes before that are
// guaranteed to have no valid byte at index (i - bytes_per_complete pixel).
@ -327,8 +327,6 @@ void PNGImageDecoderPlugin::unfilter_scanline(PNG::FilterType filter, Bytes scan
scanline_data[i] += PNG::paeth_predictor(left, above, upper_left);
}
break;
default:
VERIFY_NOT_REACHED();
}
}