xf86-video-intel: src/sna/sna_dri.c

Chris Wilson ickle at kemper.freedesktop.org
Thu Nov 15 07:14:07 PST 2012


 src/sna/sna_dri.c |    3 +++
 1 file changed, 3 insertions(+)

New commits:
commit 866ed4a26cbbb29ef3845b0aa56383c4d951c65a
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Thu Nov 15 15:13:14 2012 +0000

    sna/dri: Add a couple of more asserts to track injection of a rogue bo
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/sna_dri.c b/src/sna/sna_dri.c
index 880e9f6..f7fd293 100644
--- a/src/sna/sna_dri.c
+++ b/src/sna/sna_dri.c
@@ -456,6 +456,9 @@ static void set_bo(PixmapPtr pixmap, struct kgem_bo *bo)
 	struct sna_pixmap *priv = sna_pixmap(pixmap);
 	RegionRec region;
 
+	assert(pixmap->drawable.width * pixmap->drawable.bitsPerPixel <= 8*bo->pitch);
+	assert(pixmap->drawable.height * bo->pitch <= kgem_bo_size(bo));
+
 	/* Post damage on the new front buffer so that listeners, such
 	 * as DisplayLink know take a copy and shove it over the USB,
 	 * also for software cursors and the like.


More information about the xorg-commit mailing list