summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorConnor Behan <connor.behan@gmail.com>2015-08-23 11:46:37 -0400
committerConnor Behan <connor.behan@gmail.com>2015-08-23 11:46:37 -0400
commita4e406c20ab0590214f779c2319ac7b92594a606 (patch)
treedd4b59deb56f258933294614b17b101f2b30b758
parent70d3d3a384651e5d22840a0de8644eb8b10c5775 (diff)
Check for drawables before compositing
This should prevent a crash when something like Cairo tries to composite a solid picture. Signed-off-by: Connor Behan <connor.behan@gmail.com>
-rw-r--r--src/smi_exa.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/smi_exa.c b/src/smi_exa.c
index 70298ed..67a6fdd 100644
--- a/src/smi_exa.c
+++ b/src/smi_exa.c
@@ -623,6 +623,10 @@ SMI_PrepareComposite(int op, PicturePtr pSrcPicture, PicturePtr pMaskPicture, Pi
{
ScrnInfoPtr pScrn = xf86ScreenToScrn(pDst->drawable.pScreen);
SMIPtr pSmi = SMIPTR(pScrn);
+
+ if (!pSrc) return FALSE;
+ if (!pSrcPicture->pDrawable) return FALSE;
+
int src_pitch = exaGetPixmapPitch(pSrc) / (pSrc->drawable.bitsPerPixel >> 3);
int dst_pitch = exaGetPixmapPitch(pDst) / (pDst->drawable.bitsPerPixel >> 3);