diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2012-12-13 23:12:42 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2012-12-13 23:12:42 +0000 |
commit | 7f76f100e8033497620ee46548df45afff41064a (patch) | |
tree | ee92147f1cf9c342b24dbd45f4ed6080251d300b /src/sna | |
parent | 044a54c23384756a5dc1895473abf34f7abb3d83 (diff) |
sna/gen2: Reorder reuse_source() to avoid NULL dereference for solids
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/sna')
-rw-r--r-- | src/sna/gen2_render.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/sna/gen2_render.c b/src/sna/gen2_render.c index a059967f..c4242f46 100644 --- a/src/sna/gen2_render.c +++ b/src/sna/gen2_render.c @@ -1729,6 +1729,12 @@ reuse_source(struct sna *sna, if (src_x != msk_x || src_y != msk_y) return false; + if (sna_picture_is_solid(mask, &color)) + return gen2_composite_solid_init(sna, mc, color); + + if (sc->is_solid) + return false; + if (src == mask) { DBG(("%s: mask is source\n", __FUNCTION__)); *mc = *sc; @@ -1736,12 +1742,6 @@ reuse_source(struct sna *sna, return true; } - if (sna_picture_is_solid(mask, &color)) - return gen2_composite_solid_init(sna, mc, color); - - if (sc->is_solid) - return false; - if (src->pDrawable == NULL || mask->pDrawable != src->pDrawable) return false; |