Commit 753523c4 authored by Michael Natterer's avatar Michael Natterer 😴

Issue #1953 - Crashes during color profile conversion

gimp_image_convert_color_profile(): need to ref the src_profile across
the conversion because gimp_image_set_color_profile() might unref it.
parent ef60a04a
......@@ -442,7 +442,7 @@ gimp_image_convert_color_profile (GimpImage *image,
src_profile = gimp_color_managed_get_color_profile (GIMP_COLOR_MANAGED (image));
if (! src_profile || gimp_color_profile_is_equal (src_profile, dest_profile))
if (gimp_color_profile_is_equal (src_profile, dest_profile))
return TRUE;
if (progress)
......@@ -454,6 +454,9 @@ gimp_image_convert_color_profile (GimpImage *image,
gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_IMAGE_CONVERT,
_("Color profile conversion"));
/* retain src_profile across gimp_image_set_color_profile() */
g_object_ref (src_profile);
gimp_image_set_is_color_managed (image, TRUE, TRUE);
gimp_image_set_color_profile (image, dest_profile, NULL);
/* omg... */
......@@ -478,6 +481,8 @@ gimp_image_convert_color_profile (GimpImage *image,
break;
}
g_object_unref (src_profile);
gimp_image_undo_group_end (image);
if (progress)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment