diff --git a/app/file-data/file-data-gbr.c b/app/file-data/file-data-gbr.c index 1b30919ac1..a99b472ea0 100644 --- a/app/file-data/file-data-gbr.c +++ b/app/file-data/file-data-gbr.c @@ -275,6 +275,9 @@ file_gbr_drawable_to_brush (GimpDrawable *drawable, width = rect->width; height = rect->height; + if (width < 0 || height < 0) + return NULL; + brush = g_object_new (GIMP_TYPE_BRUSH, "name", name, "mime-type", "image/x-gimp-gbr", @@ -421,7 +424,7 @@ file_gbr_image_to_brush (GimpImage *image, const gchar *name, gdouble spacing) { - GimpBrush *brush; + GimpBrush *brush = NULL; GimpImage *subimage = NULL; GimpDrawable *drawable; gint width; diff --git a/app/file-data/file-data-gih.c b/app/file-data/file-data-gih.c index 0d9d99f29f..19dc43dc49 100644 --- a/app/file-data/file-data-gih.c +++ b/app/file-data/file-data-gih.c @@ -346,7 +346,8 @@ file_gih_image_to_pipe (GimpImage *image, gimp_object_get_name (layer), spacing); - brushes = g_list_prepend (brushes, brush); + if (brush) + brushes = g_list_prepend (brushes, brush); } } }