[gnome-color-manager] Prevent a crash in gcm-viewer when the ICC profile cannot be loaded



commit ead5c9e83a0d947741e306394508a276c27b4ec8
Author: Richard Hughes <richard hughsie com>
Date:   Mon Jan 13 12:16:50 2014 +0000

    Prevent a crash in gcm-viewer when the ICC profile cannot be loaded
    
    Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1045165

 src/gcm-viewer.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)
---
diff --git a/src/gcm-viewer.c b/src/gcm-viewer.c
index f6dce8d..3097ff0 100644
--- a/src/gcm-viewer.c
+++ b/src/gcm-viewer.c
@@ -1009,7 +1009,13 @@ gcm_viewer_set_profile (GcmViewerPrivate *viewer, CdProfile *profile)
        }
 
        /* set the preview widgets */
-       icc = cd_profile_load_icc (profile, CD_ICC_LOAD_FLAGS_ALL, NULL, NULL);
+       icc = cd_profile_load_icc (profile, CD_ICC_LOAD_FLAGS_ALL, NULL, &error);
+       if (icc == NULL) {
+               g_warning ("failed to load ICC profile: %s",
+                          error->message);
+               g_error_free (error);
+               goto out;
+       }
        if (cd_profile_get_colorspace (profile) == CD_COLORSPACE_RGB &&
            cd_profile_get_kind (profile) != CD_PROFILE_KIND_NAMED_COLOR) {
                gcm_image_set_input_profile (GCM_IMAGE(viewer->preview_widget_input), icc);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]