[PATCH xf86-video-siliconmotion] Check for drawables before compositing

Connor Behan connor.behan at gmail.com
Sun Aug 23 08:54:19 PDT 2015


This should prevent a crash when something like Cairo tries to composite
a solid picture.

Signed-off-by: Connor Behan <connor.behan at gmail.com>
---
 src/smi_exa.c | 4 ++++
 1 file changed, 4 insertions(+)

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);
 
-- 
2.5.0



More information about the xorg-devel mailing list