Fix crash when remap on palettes with more than 256 colors

This commit is contained in:
Gaspar Capello 2021-05-11 16:31:59 -03:00 committed by David Capello
parent 4c1a13bf07
commit b1203216be

View File

@ -1,6 +1,6 @@
// Aseprite Document Library
// Copyright (c) 2020 Igara Studio S.A.
// Copyright (c) 2001-2016 David Capello
// Copyright (C) 2019-2021 Igara Studio S.A.
// Copyright (C) 2001-2016 David Capello
//
// This file is released under the terms of the MIT license.
// Read LICENSE.txt for more information.
@ -157,7 +157,8 @@ bool Remap::isFor8bit() const
bool Remap::isInvertible(const PalettePicks& usedEntries) const
{
PalettePicks picks(size());
for (int i=0; i<size(); ++i) {
const int n = std::min(size(), usedEntries.size());
for (int i=0; i<n; ++i) {
if (!usedEntries[i])
continue;