1
0
mirror of git://projects.qi-hardware.com/gmenu2x.git synced 2024-06-28 12:27:37 +03:00

Fix a crasher when launching an application whose icon is corrupt

It is possible for OPK links to refer to a missing icon or to an icon
that cannot be read as a PNG file, in which cases there is no fallback
to icons/generic.png and the icon is null.

Link::paint checks for this, but LinkApp::drawLaunch did not.

Obviously it is more desirable to properly fall back, but that would be
a very big change to many areas of the code, so this is a quick fix.
This commit is contained in:
Nebuleon Fumika 2014-08-18 23:15:25 +00:00 committed by Maarten ter Huurne
parent b938c41067
commit 5758209170

View File

@ -398,7 +398,9 @@ void LinkApp::drawLaunch(Surface& s) {
gmenu2x->sc[getIcon()]->blit(gmenu2x->s,x,104);
else
gmenu2x->sc["icons/generic.png"]->blit(gmenu2x->s,x,104);*/
iconSurface->blit(s, x, gmenu2x->halfY - 16);
if (iconSurface) {
iconSurface->blit(s, x, gmenu2x->halfY - 16);
}
gmenu2x->font->write(s, text, x + 42, gmenu2x->halfY + 1, Font::HAlignLeft, Font::VAlignMiddle);
}