[gimp] Bug 709857 - Lcms plugin crashes if RGB profile does not exist
- From: Michael Natterer <mitch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] Bug 709857 - Lcms plugin crashes if RGB profile does not exist
- Date: Mon, 4 Nov 2013 22:18:54 +0000 (UTC)
commit 961d03d795e1ab32923f31e7f979f601403cdf41
Author: Michael Natterer <mitch gimp org>
Date: Mon Nov 4 23:17:41 2013 +0100
Bug 709857 - Lcms plugin crashes if RGB profile does not exist
Always check the return value of lcms_load_profile(config->rgb_profile)
and use the builtin sRGB profile if it returns NULL.
plug-ins/common/lcms.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/plug-ins/common/lcms.c b/plug-ins/common/lcms.c
index 03dba8b..c9a6676 100644
--- a/plug-ins/common/lcms.c
+++ b/plug-ins/common/lcms.c
@@ -1481,7 +1481,7 @@ lcms_icc_combo_box_new (GimpColorConfig *config,
gchar *history;
gchar *label;
gchar *name;
- cmsHPROFILE profile;
+ cmsHPROFILE profile = NULL;
dialog = lcms_icc_file_chooser_dialog_new ();
history = gimp_personal_rc_file ("profilerc");
@@ -1496,7 +1496,8 @@ lcms_icc_combo_box_new (GimpColorConfig *config,
if (config->rgb_profile)
profile = lcms_load_profile (config->rgb_profile, NULL);
- else
+
+ if (! profile)
profile = cmsCreate_sRGBProfile ();
name = lcms_icc_profile_get_desc (profile);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]