summary refs log tree commit diff
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2018-02-16 20:20:57 -0500
committerJune McEnroe <june@causal.agency>2018-02-16 20:20:57 -0500
commit5e4b4eb646cbe1ae5a642ca8bb609c8be5a70adf (patch)
tree0edae7965caceaf9b9b68abdde4a336977a0c67b
parentRefactor scanlines and filter bytes, more glitch (diff)
downloadsrc-5e4b4eb646cbe1ae5a642ca8bb609c8be5a70adf.tar.gz
src-5e4b4eb646cbe1ae5a642ca8bb609c8be5a70adf.zip
Fix pngo glitch
Basically changing the filter type without actually recalculating the
bytes results in some interesting stuff.
-rw-r--r--bin/pngo.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/bin/pngo.c b/bin/pngo.c
index 47a7ad80..bd39d6bd 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));
         }
     }