summary refs log tree commit diff
path: root/bin
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--bin/pngo.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/bin/pngo.c b/bin/pngo.c
index 90ebeea8..588eaccf 100644
--- a/bin/pngo.c
+++ b/bin/pngo.c
@@ -402,11 +402,19 @@ static void reconData(void) {
 
 static void filterData(void) {
     for (uint32_t y = header.height - 1; y < header.height; --y) {
+        if (header.color == INDEXED || header.depth < 8) {
+            *lines[y].type = NONE;
+            for (size_t i = lineSize() - 1; i < lineSize(); --i) {
+                lines[y].data[i] = filt(NONE, origBytes(y, i));
+            }
+            continue;
+        }
+
         uint8_t filter[FILTER_COUNT][lineSize()];
         uint32_t heuristic[FILTER_COUNT] = { 0 };
         enum Filter minType = NONE;
         for (enum Filter type = NONE; type < FILTER_COUNT; ++type) {
-            for (uint32_t i = 0; i < lineSize(); ++i) {
+            for (size_t i = 0; i < lineSize(); ++i) {
                 filter[type][i] = filt(type, origBytes(y, i));
                 heuristic[type] += abs((int8_t)filter[type][i]);
             }
port LibreSSL 3.3.3June McEnroe 2021-04-18build: Remove added x509_verify.3 links 3.3.2June McEnroe 2021-04-18tls: Use EC_KEY_set_ex_dataJune McEnroe 2021-04-18Import LibreSSL 3.3.2June McEnroe 2021-03-05Bump version to 3.3.1p1 3.3.1p1June McEnroe 2021-03-05build: Add OpenSSL includes to libcompatJune McEnroe 2020-12-15Import LibreSSL 3.3.1June McEnroe 2020-11-24Import LibreSSL 3.3.0June McEnroe 2020-10-22Import LibreSSL 3.2.2June McEnroe 2020-09-29Import LibreSSL 3.2.1June McEnroe 2020-09-29import: Add m4/ax_add_fortify_source.m4June McEnroe 2020-08-05build: Add README.7 to EXTRA_DIST 3.2.0June McEnroe 2020-08-03doc: Indicate that only OpenSSL 1.1.1b and newer workJune McEnroe