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
commit f0bd17e610
Notes: sideshowbarker 2024-07-18 20:39:36 +09:00

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;