xf86-video-intel: 2 commits - src/sna/blt.c src/sna/sna_accel.c

Chris Wilson ickle at kemper.freedesktop.org
Wed Sep 14 09:47:48 PDT 2011


 src/sna/blt.c       |    2 ++
 src/sna/sna_accel.c |   12 +++++++++++-
 2 files changed, 13 insertions(+), 1 deletion(-)

New commits:
commit 3565c48c4bb77c836d817de75d098791dbb529d3
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Wed Sep 14 17:45:41 2011 +0100

    sna: Yet another s/x/y/ typo
    
    Every time I do a transformation into pixmap space I like to include one
    of these copy'n'paste errors.
    
    Reported-by: Paul Neumann <paul104x at yahoo.de>
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=40850
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c
index aa12ec5..c6aac0e 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -1042,7 +1042,7 @@ sna_put_image_blt(DrawablePtr drawable, GCPtr gc, RegionPtr region,
 
 	get_drawable_deltas(drawable, pixmap, &dx, &dy);
 	x += dx + drawable->x;
-	y += dx + drawable->y;
+	y += dy + drawable->y;
 
 	DBG(("%s: upload(%d, %d, %d, %d)\n", __FUNCTION__, x, y, w, h));
 
commit 4d4aca21fd32a367d78dfaf1c23b4faeabe36428
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Wed Sep 14 13:06:26 2011 +0100

    sna: assert that the memcpy upload path points to valid regions
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/blt.c b/src/sna/blt.c
index ac20372..1d5cace 100644
--- a/src/sna/blt.c
+++ b/src/sna/blt.c
@@ -50,6 +50,8 @@ memcpy_blt(const void *src, void *dst, int bpp,
 
 	assert(width && height);
 	assert(bpp >= 8);
+	assert((src_x + width) * bpp <= 8 * src_stride);
+	assert((dst_x + width) * bpp <= 8 * dst_stride);
 
 	DBG(("%s: src=(%d, %d), dst=(%d, %d), size=%dx%d, pitch=%d/%d\n",
 	     __FUNCTION__, src_x, src_y, dst_x, dst_y, width, height, src_stride, dst_stride));
diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c
index a635372..aa12ec5 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -1053,6 +1053,16 @@ sna_put_image_blt(DrawablePtr drawable, GCPtr gc, RegionPtr region,
 	box = REGION_RECTS(region);
 	n = REGION_NUM_RECTS(region);
 	do {
+		assert(box->x1 >= 0);
+		assert(box->y1 >= 0);
+		assert(box->x2 <= pixmap->drawable.width);
+		assert(box->y2 <= pixmap->drawable.height);
+
+		assert(box->x1 - x >= 0);
+		assert(box->y1 - y >= 0);
+		assert(box->x2 - x <= w);
+		assert(box->y2 - y <= h);
+
 		memcpy_blt(bits, dst_bits,
 			   pixmap->drawable.bitsPerPixel,
 			   stride, dst_stride,


More information about the xorg-commit mailing list