mirror of
https://gitlab.gnome.org/GNOME/gimp.git
synced 2025-07-03 17:33:25 +00:00
libgimpwidgets: fix segfaults on wrongly handled referencing.
gimp_color_config_get_simulation_color_profile() is returning a new object, so we had 2 code paths giving either allocated data or not. Therefore simply ref the passed softproof profile in the second code path, and don't ref it anymore when caching it (especially as it might also be NULL at that point).
This commit is contained in:
parent
d0dd97cbc2
commit
6a08fd6596
1 changed files with 2 additions and 2 deletions
|
@ -901,7 +901,7 @@ gimp_widget_get_color_transform (GtkWidget *widget,
|
|||
proof_profile = gimp_color_config_get_simulation_color_profile (config,
|
||||
NULL);
|
||||
else
|
||||
proof_profile = softproof_profile;
|
||||
proof_profile = g_object_ref (softproof_profile);
|
||||
/* fallthru */
|
||||
|
||||
case GIMP_COLOR_MANAGEMENT_DISPLAY:
|
||||
|
@ -947,7 +947,7 @@ gimp_widget_get_color_transform (GtkWidget *widget,
|
|||
cache->src_format = src_format;
|
||||
cache->dest_profile = dest_profile;
|
||||
cache->dest_format = dest_format;
|
||||
cache->proof_profile = g_object_ref (proof_profile);
|
||||
cache->proof_profile = proof_profile;
|
||||
|
||||
cache->notify_id =
|
||||
g_signal_connect (cache->config, "notify",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue