mirror of
https://gitlab.gnome.org/GNOME/gimp.git
synced 2025-07-03 09:23:24 +00:00
plug-ins: Fix bug with pre-OSX ICNS with no masks
The 'ICON' type of ICNS is a 1 bit black and white image without a mask. The current code assumes all pre-OSX ICNS types have a mask, which caused a crash when we tried to access it. This patch adds an additional check if the mask type is 0 before trying to access it.
This commit is contained in:
parent
9eec33ba13
commit
e58527b8bb
1 changed files with 4 additions and 2 deletions
|
@ -182,7 +182,7 @@ icns_load (IcnsResource *icns,
|
|||
|
||||
if ((icns = resource_find (resources, iconTypes[i].type, nResources)))
|
||||
{
|
||||
if (! iconTypes[i].isModern)
|
||||
if (! iconTypes[i].isModern && iconTypes[i].mask)
|
||||
mask = resource_find (resources, iconTypes[i].mask, nResources);
|
||||
|
||||
icns_attach_image (image, &iconTypes[i], icns, mask, iconTypes[i].isModern);
|
||||
|
@ -224,6 +224,8 @@ icns_slurp (guchar *dest,
|
|||
dest[out * 4] = bit;
|
||||
dest[out * 4 + 1] = bit;
|
||||
dest[out * 4 + 2] = bit;
|
||||
if (! mask)
|
||||
dest[out * 4 + 3] = 255;
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
|
@ -644,7 +646,7 @@ icns_load_thumbnail_image (GFile *file,
|
|||
{
|
||||
icns = resource_find (resources, iconTypes[match].type, nResources);
|
||||
|
||||
if (! iconTypes[match].isModern)
|
||||
if (! iconTypes[match].isModern && iconTypes[i].mask)
|
||||
mask = resource_find (resources, iconTypes[match].mask, nResources);
|
||||
|
||||
icns_attach_image (image, &iconTypes[match], icns, mask, iconTypes[match].isModern);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue