sna: Add missing protection against int16 overflow when copying

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
Chris Wilson 2012-09-23 09:32:49 +01:00
parent c2ca1c5abc
commit 0fc6e5820e
1 changed files with 2 additions and 2 deletions

View File

@ -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__,