1
1
mirror of https://gitlab.gnome.org/GNOME/gimp.git synced 2025-10-06 01:12:40 +02:00

plug-ins: fix file-exr warning and a possible memory leak

This commit is contained in:
lillolollo
2025-09-03 12:59:39 +00:00
committed by Alx Sa
parent 8287302b50
commit 1a144f35a6
2 changed files with 5 additions and 2 deletions

View File

@@ -306,6 +306,9 @@ load_image (GFile *file,
gimp_image_get_default_new_layer_mode (image));
gimp_image_insert_layer (image, layer, NULL, -1);
if (i > -1)
g_free (layer_name);
buffer = gimp_drawable_get_buffer (GIMP_DRAWABLE (layer));
format = gimp_drawable_get_format (GIMP_DRAWABLE (layer));
bpp = babl_format_get_bytes_per_pixel (format);

View File

@@ -469,8 +469,8 @@ struct _EXRLoader
channels_.layers (layerNames);
name = *std::next(layerNames.begin(), index);
result = (gchar *) g_memdup2 (name.c_str () + '\0',
strlen (name.c_str ()) + 1);
result = (gchar *) g_memdup2 (name.c_str(),
name.size() + 1);
}
return result;
}