From cfbcc5ece022fc74ae9b987e05c2807df0d82ec5 Mon Sep 17 00:00:00 2001 From: Vincent Rabaud Date: Thu, 16 Jun 2016 10:34:26 +0200 Subject: [PATCH] Make sure to consider small distances in LZ77. This could corrupt certain images since commit a3611513d2bf465fd282d9dc45b3f72c79c232ad Change-Id: Ifbe43abaafe8efb27c62af18039fea5a9dc4e062 --- src/enc/backward_references.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/enc/backward_references.c b/src/enc/backward_references.c index c7bddcaf..314ca894 100644 --- a/src/enc/backward_references.c +++ b/src/enc/backward_references.c @@ -464,7 +464,7 @@ static int BackwardReferencesLz77(int xsize, int ysize, } } } else { - len = 1; + len = (len == 0) ? 1 : len; } // Go with literal or backward reference. assert(len > 0);