1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 21:18:14 +00:00

LibGfx: Zero out dummy filter scanline

As per the PNG specification: "For all x < 0, assume Raw(x) = 0 and
Prior(x) = 0. On the first scanline of an image (or of a pass of an
interlaced image), assume Prior(x) = 0 for all x."
This commit is contained in:
Idan Horowitz 2021-04-07 17:21:38 +03:00 committed by Andreas Kling
parent 5e8b5ff35e
commit f0bd17e610

View file

@ -477,6 +477,7 @@ NEVER_INLINE FLATTEN static bool unfilter(PNGLoadingContext& context)
}
u8 dummy_scanline[context.width * sizeof(RGBA32)];
memset(dummy_scanline, 0, sizeof(dummy_scanline));
for (int y = 0; y < context.height; ++y) {
auto filter = context.scanlines[y].filter;