[gnome-color-manager] Don't crash when the EDID data is not available



commit 232ef11a8f09f3b32d07961b207cc8826a3dbc2e
Author: Richard Hughes <richard hughsie com>
Date:   Mon Nov 2 23:50:05 2009 +0000

    Don't crash when the EDID data is not available

 src/gcm-calibrate.c |    6 +++++-
 src/gcm-utils.c     |    3 +++
 2 files changed, 8 insertions(+), 1 deletions(-)
---
diff --git a/src/gcm-calibrate.c b/src/gcm-calibrate.c
index 0086ebd..fb8b974 100644
--- a/src/gcm-calibrate.c
+++ b/src/gcm-calibrate.c
@@ -268,8 +268,12 @@ gcm_calibrate_task_neutralise (GcmCalibrate *calibrate, GError **error)
 		goto out;
 	}
 
-	/* parse edid */
+	/* get edid */
 	data = gnome_rr_output_get_edid_data (output);
+	if (data == NULL)
+		goto out;
+
+	/* parse edid */
 	ret = gcm_edid_parse (priv->edid, data, error);
 	if (!ret)
 		goto out;
diff --git a/src/gcm-utils.c b/src/gcm-utils.c
index 8c120fd..853c241 100644
--- a/src/gcm-utils.c
+++ b/src/gcm-utils.c
@@ -51,6 +51,9 @@ gcm_utils_get_output_name (GnomeRROutput *output)
 
 	/* parse the EDID to get a crtc-specific name, not an output specific name */
 	data = gnome_rr_output_get_edid_data (output);
+	if (data == NULL)
+		goto out;
+
 	edid = gcm_edid_new ();
 	ret = gcm_edid_parse (edid, data, NULL);
 	if (!ret) {



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