[gnome-desktop] Avoid a possible crash



commit b8849c08adb1ba1b55d1a3511dd9eefd00504dc0
Author: Matthias Clasen <mclasen redhat com>
Date:   Mon Apr 4 11:18:49 2011 -0400

    Avoid a possible crash
    
    When the spice client goes to fullscreen it (temporarily) turns all xrandr
    outputs off (for some reason). This causes gnome-settings-daemon to crash (and
    respawn and reset the old screen size) due to a NULL deref in libgnome-desktop.
    
    Patch by Alex Larsson
    https://bugzilla.gnome.org/show_bug.cgi?id=646714

 libgnome-desktop/gnome-rr-config.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/libgnome-desktop/gnome-rr-config.c b/libgnome-desktop/gnome-rr-config.c
index 5eae693..9511034 100644
--- a/libgnome-desktop/gnome-rr-config.c
+++ b/libgnome-desktop/gnome-rr-config.c
@@ -1228,7 +1228,8 @@ gnome_rr_config_ensure_primary (GnomeRRConfig *configuration)
         if (!found) {
                 if (laptop != NULL) {
                         laptop->priv->primary = TRUE;
-                } else {
+                } else if (top_left != NULL) {
+                        /* Note: top_left can be NULL if all outputs are off */
                         top_left->priv->primary = TRUE;
                 }
         }



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