Fix crash when the gif decoder cannot create the sprite

This commit is contained in:
David Capello 2015-07-30 12:36:27 -03:00
parent 32b12d17da
commit 4a1356cf78

View File

@ -204,14 +204,18 @@ public:
} }
} }
// Add entries to include the transparent color if (m_sprite) {
if (m_bgIndex >= m_sprite->palette(0)->size()) // Add entries to include the transparent color
m_sprite->palette(0)->resize(m_bgIndex+1); if (m_bgIndex >= m_sprite->palette(0)->size())
m_sprite->palette(0)->resize(m_bgIndex+1);
if (m_layer && m_opaque) if (m_layer && m_opaque)
m_layer->configureAsBackground(); m_layer->configureAsBackground();
return (m_sprite != nullptr); return true;
}
else
return false;
} }
private: private: