diff --git a/src/app/file/gif_format.cpp b/src/app/file/gif_format.cpp index 9750e78d0..93f0e4dc3 100644 --- a/src/app/file/gif_format.cpp +++ b/src/app/file/gif_format.cpp @@ -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