[gnome-settings-daemon] color: Do not segfault when doing fast-user-switching into a new account



commit e24d4df228e07f89598017c89e3102c80e761dfd
Author: Richard Hughes <richard hughsie com>
Date:   Fri Sep 9 14:52:07 2011 +0100

    color: Do not segfault when doing fast-user-switching into a new account
    
    This prevents the crash, but we need to look at the correct behaviour for FUS
    and when to apply the color profile for the new user.
    
    Resolves https://bugzilla.redhat.com/show_bug.cgi?id=736846

 plugins/color/gsd-color-manager.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)
---
diff --git a/plugins/color/gsd-color-manager.c b/plugins/color/gsd-color-manager.c
index 343c036..0e710fc 100644
--- a/plugins/color/gsd-color-manager.c
+++ b/plugins/color/gsd-color-manager.c
@@ -828,12 +828,19 @@ gcm_session_device_set_gamma (GnomeRROutput *output,
                               CdProfile *profile,
                               GError **error)
 {
-        gboolean ret;
+        gboolean ret = FALSE;
         GPtrArray *clut = NULL;
 
         /* create a lookup table */
         clut = gcm_session_generate_vcgt (profile,
                                           gnome_rr_output_get_gamma_size (output));
+        if (clut == NULL) {
+                g_set_error_literal (error,
+                                     GSD_COLOR_MANAGER_ERROR,
+                                     GSD_COLOR_MANAGER_ERROR_FAILED,
+                                     "failed to generate vcgt");
+                goto out;
+        }
 
         /* apply the vcgt to this output */
         ret = gcm_session_output_set_gamma (output, clut, error);



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