aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/dix/dispatch.c
diff options
context:
space:
mode:
Diffstat (limited to 'xorg-server/dix/dispatch.c')
-rw-r--r--xorg-server/dix/dispatch.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/xorg-server/dix/dispatch.c b/xorg-server/dix/dispatch.c
index 43cb4d1d3..6e3361573 100644
--- a/xorg-server/dix/dispatch.c
+++ b/xorg-server/dix/dispatch.c
@@ -2029,6 +2029,14 @@ DoGetImage(ClientPtr client, int format, Drawable drawable,
if (!pWin->viewable)
return BadMatch;
+ /* If the drawable is a window, the rectangle must be contained within
+ * its bounds (including the border). */
+ if (x < -wBorderWidth(pWin) ||
+ x + width > wBorderWidth(pWin) + (int)pDraw->width ||
+ y < -wBorderWidth(pWin) ||
+ y + height > wBorderWidth(pWin) + (int)pDraw->height)
+ return BadMatch;
+
relx += pDraw->x;
rely += pDraw->y;
@@ -3898,6 +3906,8 @@ AddScreen(
return -1;
}
+ update_desktop_dimensions();
+
dixRegisterScreenPrivateKey(&cursorScreenDevPriv, pScreen, PRIVATE_CURSOR, 0);
return i;