From 6a9d1ed0c82d4eb51c15824ed895cd9446ee158b Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Fri, 14 Jan 2011 02:57:07 +0000 Subject: [PATCH] avoid null deref SVN revision: 56084 --- legacy/ecore/src/lib/ecore_x/xlib/ecore_x_randr_12.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_randr_12.c b/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_randr_12.c index bd562285ac..ad1192c110 100644 --- a/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_randr_12.c +++ b/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_randr_12.c @@ -1788,7 +1788,7 @@ ecore_x_randr_move_crtcs(Ecore_X_Window root, goto _ecore_x_randr_move_crtcs_fail_free_crtc_info; //actually move all the crtcs, keep their rotation and mode. - for (i = 0; i < ncrtc; i++) + for (i = 0; (i < ncrtc) && crtc_info[i]; i++) { if (!ecore_x_randr_crtc_settings_set(root, crtcs[i], NULL, Ecore_X_Randr_Unset, @@ -1805,7 +1805,7 @@ ecore_x_randr_move_crtcs(Ecore_X_Window root, { //something went wrong, let's try to move the already moved crtcs //back. - while (i-- >= 0) + while (((i--) >= 0)) ecore_x_randr_crtc_settings_set(root, crtcs[i], NULL,