1
1
mirror of https://gitlab.gnome.org/GNOME/gimp.git synced 2025-10-06 09:32:41 +02:00

plug-ins: Take zero length layer names into account in psp reader.

This commit is contained in:
Jacob Boerema
2020-08-23 18:30:41 -04:00
parent 56982e6ce9
commit d7089c93b2

View File

@@ -1510,9 +1510,11 @@ read_layer_block (FILE *f,
{
if (fread (&chunk_len, 4, 1, f) < 1
|| fread (&namelen, 2, 1, f) < 1
|| ((namelen = GUINT16_FROM_LE (namelen)) && FALSE)
/* A zero length layer name is apparently valid. To not get a warning for
namelen < 0 always being false we use this more complicated comparison. */
|| ((namelen = GUINT16_FROM_LE (namelen)) && (FALSE || namelen == 0))
|| (name = g_malloc (namelen + 1)) == NULL
|| fread (name, namelen, 1, f) < 1
|| (namelen > 0 && fread (name, namelen, 1, f) < 1)
|| fread (&type, 1, 1, f) < 1
|| fread (&image_rect, 16, 1, f) < 1
|| fread (&saved_image_rect, 16, 1, f) < 1