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.
This commit is contained in:
Michael Natterer 2013-11-04 23:17:41 +01:00
parent 48582d4d6a
commit 961d03d795
1 changed files with 3 additions and 2 deletions

View File

@ -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);