From 23bc42627f7a8ff051d78bdc152c30bfd45fcf55 Mon Sep 17 00:00:00 2001 From: Monsta Date: Mon, 5 Jan 2015 18:14:32 +0300 Subject: xrandr: safer access to list element's data g_list_nth_data just returns NULL if either list or element is NULL Closes https://github.com/mate-desktop/mate-control-center/pull/138 --- capplets/display/xrandr-capplet.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'capplets') diff --git a/capplets/display/xrandr-capplet.c b/capplets/display/xrandr-capplet.c index 5baa6378..023cbe7e 100644 --- a/capplets/display/xrandr-capplet.c +++ b/capplets/display/xrandr-capplet.c @@ -1751,7 +1751,7 @@ paint_output (App *app, cairo_t *cr, int i) MateRRRotation rotation; int total_w, total_h; GList *connected_outputs = list_connected_outputs (app, &total_w, &total_h); - MateRROutputInfo *output = g_list_nth (connected_outputs, i)->data; + MateRROutputInfo *output = g_list_nth_data (connected_outputs, i); PangoLayout *layout = get_display_name (app, output); PangoRectangle ink_extent, log_extent; GdkRectangle viewport; -- cgit v1.2.1