From 866ed4a26cbbb29ef3845b0aa56383c4d951c65a Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Thu, 15 Nov 2012 15:13:14 +0000 Subject: [PATCH] sna/dri: Add a couple of more asserts to track injection of a rogue bo Signed-off-by: Chris Wilson --- src/sna/sna_dri.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/sna/sna_dri.c b/src/sna/sna_dri.c index 880e9f6a..f7fd2931 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.