summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPauli Nieminen <ext-pauli.nieminen@nokia.com>2010-06-14 13:45:08 +0300
committerAlan Coopersmith <alan.coopersmith@oracle.com>2013-07-05 21:10:43 -0700
commit4e4bbb85499cff052ce03e173b88f1083ba83f86 (patch)
treea0635cf84bc438f2f6911df97b903bcf9ad10c61 /src
parent9e4abe746786f0f632d1f82f99fe0c6b8ffedf9e (diff)
XRRUpdateConfiguration: Check if getting screen for root fails
XRRRootToScreen might return -1 if it fails to find screen for the root window. Following code uses screen number unconditionally to index the screen array. Signed-off-by: Pauli Nieminen <ext-pauli.nieminen@nokia.com> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Diffstat (limited to 'src')
-rw-r--r--src/Xrandr.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/Xrandr.c b/src/Xrandr.c
index b1e97ec..a9fba87 100644
--- a/src/Xrandr.c
+++ b/src/Xrandr.c
@@ -483,6 +483,9 @@ int XRRUpdateConfiguration(XEvent *event)
scevent = (XRRScreenChangeNotifyEvent *) event;
snum = XRRRootToScreen(dpy,
((XRRScreenChangeNotifyEvent *) event)->root);
+ if (snum < 0)
+ return 0;
+
if (scevent->rotation & (RR_Rotate_90 | RR_Rotate_270)) {
dpy->screens[snum].width = scevent->height;
dpy->screens[snum].height = scevent->width;