diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2013-07-20 18:08:22 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2013-07-20 18:14:55 +0100 |
commit | f39d9ed0929f83e65dde8da8f03fae6ba8264e4a (patch) | |
tree | b90b09ca0c9bcf4d6d1b2dc728e2ce7d003f916d | |
parent | f915d4a224eb686ad18b62ca0258e056b4a483cc (diff) |
sna: Correct typo in checking src extents before performing memcpy
A regression in
commit 6921abd81017c9ed7f3b2413784068fbc609a0ea
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date: Thu Jul 18 16:21:27 2013 +0100
sna: Add a fast path for the most common fallback for CPU-CPU blits
And add the full set of assertions to validate the memcpy.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r-- | src/sna/sna_composite.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/sna/sna_composite.c b/src/sna/sna_composite.c index 3cd82699..38f12190 100644 --- a/src/sna/sna_composite.c +++ b/src/sna/sna_composite.c @@ -530,7 +530,7 @@ sna_composite_fb(CARD8 op, region->extents.x1 + src_x + tx >= 0 && region->extents.y1 + src_y + ty >= 0 && region->extents.x2 + src_x + tx <= src->pDrawable->width && - region->extents.x2 + src_y + ty <= src->pDrawable->height) { + region->extents.y2 + src_y + ty <= src->pDrawable->height) { PixmapPtr dst_pixmap = get_drawable_pixmap(dst->pDrawable); PixmapPtr src_pixmap = get_drawable_pixmap(src->pDrawable); int nbox = RegionNumRects(region); @@ -545,6 +545,18 @@ sna_composite_fb(CARD8 op, dst_x += tx, dst_y += ty; do { + assert(box->x1 + src_x >= 0); + assert(box->x2 + src_x <= src_pixmap->drawable.width); + assert(box->y1 + src_y >= 0); + assert(box->y2 + src_y <= src_pixmap->drawable.height); + + assert(box->x1 + dst_x >= 0); + assert(box->x2 + dst_x <= dst_pixmap->drawable.width); + assert(box->y1 + dst_y >= 0); + assert(box->y2 + dst_y <= dst_pixmap->drawable.height); + + assert(box->x2 > box->x1 && box->y2 > box->y1); + memcpy_blt(src_pixmap->devPrivate.ptr, dst_pixmap->devPrivate.ptr, dst_pixmap->drawable.bitsPerPixel, |