From 7aa7a5adb26ade88444fc8afaf16894f29e86f7d Mon Sep 17 00:00:00 2001 From: Curtis McEnroe Date: Fri, 16 Feb 2018 20:20:57 -0500 Subject: Fix pngo glitch Basically changing the filter type without actually recalculating the bytes results in some interesting stuff. --- bin/pngo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'bin') diff --git a/bin/pngo.c b/bin/pngo.c index 878b55a0..6dd88c87 100644 --- a/bin/pngo.c +++ b/bin/pngo.c @@ -309,7 +309,7 @@ static void filterData(struct Header header, const struct Scanline *lines) { for (uint32_t y = header.height - 1; y < header.height; --y) { // TODO: Filter type heuristic. *lines[y].type = FILT_PAETH; - for (uint32_t i = (bpp * header.width) - 1; i < bpp * header.width; ++i) { + for (uint32_t i = (bpp * header.width) - 1; i < bpp * header.width; --i) { lines[y].data[i] = filt(*lines[y].type, filterBytes(lines, bpp, y, i)); } } -- cgit 1.4.1