From 49a65edfc31230cc1930f3789a7a79f932a1a9ed Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Thu, 5 Jan 2023 07:24:24 +0300 Subject: [PATCH] engine: imagelib: img_quant: fix a bug in quantizer (thanks, @SNMetamorph for fix) --- engine/common/imagelib/img_quant.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/engine/common/imagelib/img_quant.c b/engine/common/imagelib/img_quant.c index eb5e2e50..e450e14f 100644 --- a/engine/common/imagelib/img_quant.c +++ b/engine/common/imagelib/img_quant.c @@ -408,7 +408,7 @@ void learn( void ) if( rad ) alterneigh( rad, j, r, g, b ); // alter neighbours p += step; - if( p >= lim ) p -= lengthcount; + while( p >= lim ) p -= lengthcount; i++;