Comment 6 for bug 1015292

Revision history for this message
Ricardo Salveti (rsalveti) wrote : Re: QT5 based applications fails with a segmentation fault with Pandaboard and the SGX driver

If the pointer is also checked at the xorg side, it works as expected. Tested with the patch:

commit 6e83934da0288e9a182c0f7982871ea5eaff1cec
Author: Ricardo Salveti de Araujo <email address hidden>
Date: Wed Jun 20 20:19:09 2012 -0300

    randr: first check pSrcPriv before using the pointer at RRFirstOutput

    Fix a seg fault in case pSrcPriv fails to be allocated at
    ProcRRGetScreenInfo, which later calls RRFirstOutput.

    Signed-off-by: Ricardo Salveti de Araujo <email address hidden>

diff --git a/randr/randr.c b/randr/randr.c
index 4d4298a..9432819 100644
--- a/randr/randr.c
+++ b/randr/randr.c
@@ -446,6 +446,9 @@ RRFirstOutput(ScreenPtr pScreen)
     RROutputPtr output;
     int i, j;

+ if (!pSrcPriv)
+ return NULL;
+
     if (pScrPriv->primaryOutput && pScrPriv->primaryOutput->crtc)
         return pScrPriv->primaryOutput;