[aseprite] 84/250: Don't change mask-index entry if it's out of the bound in PaletteOptimizer::calculate()

Tobias Hansen thansen at moszumanska.debian.org
Sun Dec 20 15:27:15 UTC 2015


This is an automated email from the git hooks/post-receive script.

thansen pushed a commit to branch master
in repository aseprite.

commit 3c219571b1713be830a15074152b8dfcbb498259
Author: David Capello <davidcapello at gmail.com>
Date:   Thu Sep 24 23:39:36 2015 -0300

    Don't change mask-index entry if it's out of the bound in PaletteOptimizer::calculate()
---
 src/render/quantization.cpp | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/render/quantization.cpp b/src/render/quantization.cpp
index c82f325..8bff4b6 100644
--- a/src/render/quantization.cpp
+++ b/src/render/quantization.cpp
@@ -403,7 +403,9 @@ void PaletteOptimizer::calculate(Palette* palette, int maskIndex,
       remap.map(i, i + (i >= maskIndex ? 1: 0));
 
     palette->applyRemap(remap);
-    palette->setEntry(maskIndex, rgba(0, 0, 0, 255));
+
+    if (maskIndex < palette->size())
+      palette->setEntry(maskIndex, rgba(0, 0, 0, 255));
   }
   else
     palette->resize(MAX(1, usedColors));

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/aseprite.git



More information about the Pkg-games-commits mailing list