From 0fc6e5820e4543d52bcf8d0285ca6f69b5213831 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Sun, 23 Sep 2012 09:32:49 +0100 Subject: [PATCH] sna: Add missing protection against int16 overflow when copying Signed-off-by: Chris Wilson --- src/sna/sna_accel.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c index fbee637a..58029c89 100644 --- a/src/sna/sna_accel.c +++ b/src/sna/sna_accel.c @@ -4867,8 +4867,8 @@ sna_do_copy(DrawablePtr src, DrawablePtr dst, GCPtr gc, region.extents.x1 = dx; region.extents.y1 = dy; - region.extents.x2 = dx + width; - region.extents.y2 = dy + height; + region.extents.x2 = bound(dx, width); + region.extents.y2 = bound(dy, height); region.data = NULL; DBG(("%s: dst extents (%d, %d), (%d, %d)\n", __FUNCTION__,