[PATCH 2/2] exa: Verify non-null pSrc in mgaDownloadFromScreen()

Tormod Volden lists.tormod at gmail.com
Mon Mar 2 12:01:15 PST 2015


From: Tormod Volden <debian.tormod at gmail.com>

Thanks to Connor Behan for the suggestion.

Signed-off-by: Tormod Volden <debian.tormod at gmail.com>
---

Also not tested on hardware.

Tormod

 src/mga_exa.c |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/mga_exa.c b/src/mga_exa.c
index 24a7328..cb17ad8 100644
--- a/src/mga_exa.c
+++ b/src/mga_exa.c
@@ -727,6 +727,9 @@ static Bool
 mgaDownloadFromScreen(PixmapPtr pSrc, int x, int y, int w, int h,
                       char *dst, int dst_pitch)
 {
+    if (!pSrc)
+	return FALSE;
+
     PMGA(pSrc);
 
     char *src = pMga->ExaDriver->memoryBase + exaGetPixmapOffset(pSrc);
-- 
1.7.10.4



More information about the xorg-devel mailing list