[gnome-color-manager] Don't segfault if cmsCreateRGBProfile fails. Fixes rh#653419
- From: Richard Hughes <rhughes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-color-manager] Don't segfault if cmsCreateRGBProfile fails. Fixes rh#653419
- Date: Mon, 15 Nov 2010 16:30:43 +0000 (UTC)
commit 579a88f91ba5d72fdb7d6a97174b863a7200cd38
Author: Richard Hughes <richard hughsie com>
Date: Mon Nov 15 16:30:05 2010 +0000
Don't segfault if cmsCreateRGBProfile fails. Fixes rh#653419
libcolor-glib/gcm-profile.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/libcolor-glib/gcm-profile.c b/libcolor-glib/gcm-profile.c
index 74adaa8..2605a87 100644
--- a/libcolor-glib/gcm-profile.c
+++ b/libcolor-glib/gcm-profile.c
@@ -1289,6 +1289,10 @@ gcm_profile_create_from_chroma (GcmProfile *profile, gdouble gamma,
/* create our generated profile */
priv->lcms_profile = cmsCreateRGBProfile (&white_point, &chroma, transfer_curve);
+ if (priv->lcms_profile == NULL) {
+ g_set_error (error, 1, 0, "failed to create profile");
+ goto out;
+ }
cmsSetEncodedICCversion (priv->lcms_profile, 2);
cmsFreeToneCurve (*transfer_curve);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]