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.