Skip to content

Commit 000d9da

Browse files
nicoawesomekling
authored andcommitted
LibGfx: Allow passing FilterType::None to unfilter_scanline()
Makes calling this in LibPDF less awkward, and there's no reason not to allow this.
1 parent 574357e commit 000d9da

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

Userland/Libraries/LibGfx/ImageFormats/PNGLoader.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -291,9 +291,9 @@ static_assert(AssertSize<Pixel, 4>());
291291

292292
void PNGImageDecoderPlugin::unfilter_scanline(PNG::FilterType filter, Bytes scanline_data, ReadonlyBytes previous_scanlines_data, u8 bytes_per_complete_pixel)
293293
{
294-
VERIFY(filter != PNG::FilterType::None);
295-
296294
switch (filter) {
295+
case PNG::FilterType::None:
296+
break;
297297
case PNG::FilterType::Sub:
298298
// This loop starts at bytes_per_complete_pixel because all bytes before that are
299299
// 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
327327
scanline_data[i] += PNG::paeth_predictor(left, above, upper_left);
328328
}
329329
break;
330-
default:
331-
VERIFY_NOT_REACHED();
332330
}
333331
}
334332

0 commit comments

Comments
 (0)