summaryrefslogtreecommitdiff
path: root/src/sna/gen2_render.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2014-04-04 15:56:38 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2014-04-04 15:56:38 +0100
commit938eea6dee0be153fcf007549a50213f6c957305 (patch)
treeefce76a253404bf802da02b9152a05b2be879c7f /src/sna/gen2_render.c
parent564e4a9878503c880e0cbd09d88b4c246a0267b6 (diff)
sna/gen2+: Beware the unattached ShmPixmap
When dereferences priv, make sure it exists first. ShmPixmaps for example, may not have one, nor do very small buffers. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/sna/gen2_render.c')
-rw-r--r--src/sna/gen2_render.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/sna/gen2_render.c b/src/sna/gen2_render.c
index 698ed99b..a4788177 100644
--- a/src/sna/gen2_render.c
+++ b/src/sna/gen2_render.c
@@ -1564,7 +1564,7 @@ gen2_composite_picture(struct sna *sna,
x + w < pixmap->drawable.width &&
y + h < pixmap->drawable.height)) {
struct sna_pixmap *priv = sna_pixmap(pixmap);
- if (priv->clear) {
+ if (priv && priv->clear) {
DBG(("%s: converting large pixmap source into solid [%08x]\n", __FUNCTION__, priv->clear_color));
return gen2_composite_solid_init(sna, channel, priv->clear_color);
}