From bc753c5bc137370beb7152745f073f72922bf0f1 Mon Sep 17 00:00:00 2001 From: David Capello Date: Wed, 5 Jan 2011 20:11:58 -0300 Subject: [PATCH] Fix Palette:countDiff() bug when "to" must be equal to max-1. --- src/raster/palette.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/raster/palette.cpp b/src/raster/palette.cpp index 4716f949c..e402eb8a0 100644 --- a/src/raster/palette.cpp +++ b/src/raster/palette.cpp @@ -122,7 +122,7 @@ int Palette::countDiff(const Palette* other, int* from, int* to) const if (max != min) { diff += max - min; - if (to) *to = max; + if (to) *to = max-1; } return diff;