[gnome-color-manager: 14/18] trivial: avoid segfault if the profile does not have a backing file and we try to apply it



commit afe4d4ec394ac790174f45d9c4c62079c0d38760
Author: Richard Hughes <richard hughsie com>
Date:   Fri Oct 8 17:58:15 2010 +0100

    trivial: avoid segfault if the profile does not have a backing file and we try to apply it

 src/gcm-device-xrandr.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/src/gcm-device-xrandr.c b/src/gcm-device-xrandr.c
index 88de7bd..ceacf33 100644
--- a/src/gcm-device-xrandr.c
+++ b/src/gcm-device-xrandr.c
@@ -592,6 +592,11 @@ gcm_device_xrandr_apply (GcmDevice *device, GError **error)
 	} else {
 		/* set the per-output and per screen profile atoms */
 		filename = gcm_profile_get_filename (profile);
+		if (filename == NULL) {
+			ret = FALSE;
+			g_set_error_literal (error, 1, 0, "no filename for profile");
+			goto out;
+		}
 		ret = gcm_x11_output_set_profile (output, filename, error);
 		if (!ret)
 			goto out;



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