diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2013-03-11 17:14:39 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2013-03-11 18:16:34 +0000 |
commit | 44d3ffdf534eb1c24ab729b9af31f09a86b82256 (patch) | |
tree | 24bcee7a0493287402856bd47e32cada3c9d75b2 /src | |
parent | b500e30d5dbcf91542c2831ebd3c48b28a01bf28 (diff) |
sna: Only allocate addition space if we need pixel data
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src')
-rw-r--r-- | src/sna/sna_accel.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c index 35c2a902..662304db 100644 --- a/src/sna/sna_accel.c +++ b/src/sna/sna_accel.c @@ -725,7 +725,7 @@ create_pixmap(struct sna *sna, ScreenPtr screen, datasize = height * stride; base = screen->totalPixmapSize; - if (base & 15) { + if (datasize && base & 15) { int adjust = 16 - (base & 15); base += adjust; datasize += adjust; @@ -753,7 +753,7 @@ create_pixmap(struct sna *sna, ScreenPtr screen, pixmap->drawable.height = height; pixmap->devKind = stride; pixmap->refcnt = 1; - pixmap->devPrivate.ptr = (char *)pixmap + base; + pixmap->devPrivate.ptr = datasize ? (char *)pixmap + base : NULL; #ifdef COMPOSITE pixmap->screen_x = 0; |