From fc159fbcaef87b2bcfa5ec33b47ea4ff2875727c Mon Sep 17 00:00:00 2001 From: Cedric BAIL Date: Mon, 4 Aug 2014 11:55:05 +0200 Subject: [PATCH] ecore_x: don't go below 0. It seems that when things go wrong it does happen that we start with i == 0. It will then have been walking into info[-1] 'happily'. Changing the test, to first decrement and then compare should stop that issue. This should @fix T1467. --- src/lib/ecore_x/xlib/ecore_x_randr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/ecore_x/xlib/ecore_x_randr.c b/src/lib/ecore_x/xlib/ecore_x_randr.c index db1f10968c..99d630c02c 100644 --- a/src/lib/ecore_x/xlib/ecore_x_randr.c +++ b/src/lib/ecore_x/xlib/ecore_x_randr.c @@ -2458,7 +2458,7 @@ ecore_x_randr_move_crtcs(Ecore_X_Window root, const Ecore_X_Randr_Crtc *crtcs, i if (i < ncrtc) { /* something went wrong somewhere. move everything back */ - while (i-- >= 0) + while ((--i) >= 0) { if (info[i]) ecore_x_randr_crtc_settings_set(root, crtcs[i], NULL, -1,