From e39bec8725e9e31819e2473296dceac0939917d8 Mon Sep 17 00:00:00 2001 From: Ivan Smirnov Date: Mon, 3 Jan 2022 17:11:39 +0300 Subject: [PATCH] Bug-fix with non-reference encoding --- src/encode.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/encode.rs b/src/encode.rs index d28c6d9..bd08c77 100644 --- a/src/encode.rs +++ b/src/encode.rs @@ -35,7 +35,7 @@ where if run != 0 { #[cfg(not(feature = "reference"))] { - buf = buf.write_one(if run == 1 { + buf = buf.write_one(if run == 1 && i != 1 { QOI_OP_INDEX | (hash_prev as u8) } else { QOI_OP_RUN | (run - 1)