summaryrefslogtreecommitdiff
blob: 0c5ca3c83ba5a93a956ded7a66582ad29a46d7cf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
From: Kai-Uwe Behrmann <ku.b@gmx.de>
Date: Mon, 18 Mar 2013 18:07:16 +0000 (+0100)
Subject: * [oyX1]: fix array access
X-Git-Url: http://www.oyranos.org/scm?p=oyranos.git;a=commitdiff_plain;h=11d848a38608deeeca61288d46cfca55c6916788

* [oyX1]: fix array access
---

diff --git a/src/modules/devices/oyranos_monitor_x11.c b/src/modules/devices/oyranos_monitor_x11.c
index a530a81..bac09c1 100644
--- a/src/modules/devices/oyranos_monitor_x11.c
+++ b/src/modules/devices/oyranos_monitor_x11.c
@@ -1329,6 +1329,13 @@ oyX1Monitor_s* oyX1Monitor_newFrom_      ( const char        * display_name,
         int n_scr_info = 0;
         XineramaScreenInfo *scr_info = XineramaQueryScreens( display,
                                                              &n_scr_info );
+        if(n_scr_info <= selected_screen)
+        {
+          XFree( scr_info );
+          oyX1Monitor_release_( &disp );
+          return 0;
+        }
+
         geo[0] = scr_info[selected_screen].x_org;
         geo[1] = scr_info[selected_screen].y_org;
         geo[2] = scr_info[selected_screen].width;