Don't use global colormap if the used sprite palette is bigger

This can happen when if an extra copy of the bg/transparent color was
added to the palette.
This commit is contained in:
David Capello 2015-07-31 12:27:57 -03:00
parent a9097c3a1a
commit 40c0ef2d48

View File

@ -215,7 +215,9 @@ public:
// Use the original global color map
if (m_sprite->pixelFormat() == IMAGE_INDEXED &&
m_gifFile->SColorMap && !m_hasLocalColormaps) {
m_gifFile->SColorMap &&
m_gifFile->SColorMap->ColorCount >= m_sprite->palette(0)->size() &&
!m_hasLocalColormaps) {
remapToGlobalColormap();
}
// Avoid huge color palettes