You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gentoo-overlay/media-libs/oyranos/files/oyranos-0.9.4-fix-array-acc...

28 lines
1.1 KiB

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;