diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2014-04-04 15:56:38 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2014-04-04 15:56:38 +0100 |
commit | 938eea6dee0be153fcf007549a50213f6c957305 (patch) | |
tree | efce76a253404bf802da02b9152a05b2be879c7f /src | |
parent | 564e4a9878503c880e0cbd09d88b4c246a0267b6 (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')
-rw-r--r-- | src/sna/gen2_render.c | 2 | ||||
-rw-r--r-- | src/sna/gen3_render.c | 2 | ||||
-rw-r--r-- | src/sna/gen4_render.c | 2 | ||||
-rw-r--r-- | src/sna/gen5_render.c | 2 | ||||
-rw-r--r-- | src/sna/gen6_render.c | 2 | ||||
-rw-r--r-- | src/sna/gen7_render.c | 3 | ||||
-rw-r--r-- | src/sna/gen8_render.c | 2 |
7 files changed, 8 insertions, 7 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); } diff --git a/src/sna/gen3_render.c b/src/sna/gen3_render.c index a30ee441..1bfc509c 100644 --- a/src/sna/gen3_render.c +++ b/src/sna/gen3_render.c @@ -3100,7 +3100,7 @@ gen3_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 gen3_init_solid(channel, priv->clear_color); } diff --git a/src/sna/gen4_render.c b/src/sna/gen4_render.c index 9994bf57..ee96f6cc 100644 --- a/src/sna/gen4_render.c +++ b/src/sna/gen4_render.c @@ -1591,7 +1591,7 @@ gen4_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 gen4_channel_init_solid(sna, channel, priv->clear_color); } diff --git a/src/sna/gen5_render.c b/src/sna/gen5_render.c index 6408eec0..51a9714f 100644 --- a/src/sna/gen5_render.c +++ b/src/sna/gen5_render.c @@ -1530,7 +1530,7 @@ gen5_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 gen4_channel_init_solid(sna, channel, priv->clear_color); } diff --git a/src/sna/gen6_render.c b/src/sna/gen6_render.c index 867108b3..319cdedc 100644 --- a/src/sna/gen6_render.c +++ b/src/sna/gen6_render.c @@ -1780,7 +1780,7 @@ gen6_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 gen4_channel_init_solid(sna, channel, priv->clear_color); } diff --git a/src/sna/gen7_render.c b/src/sna/gen7_render.c index 319f4a3f..334958ad 100644 --- a/src/sna/gen7_render.c +++ b/src/sna/gen7_render.c @@ -2026,6 +2026,7 @@ gen7_composite_picture(struct sna *sna, channel->repeat = picture->repeat ? picture->repeatType : RepeatNone; channel->filter = picture->filter; + assert(picture->pDrawable); pixmap = get_drawable_pixmap(picture->pDrawable); get_drawable_deltas(picture->pDrawable, pixmap, &dx, &dy); @@ -2047,7 +2048,7 @@ gen7_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 gen4_channel_init_solid(sna, channel, priv->clear_color); } diff --git a/src/sna/gen8_render.c b/src/sna/gen8_render.c index 0c851c88..1fb9909a 100644 --- a/src/sna/gen8_render.c +++ b/src/sna/gen8_render.c @@ -1820,7 +1820,7 @@ gen8_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 gen4_channel_init_solid(sna, channel, priv->clear_color); } |