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;
If the pointer is also checked at the xorg side, it works as expected. Tested with the patch:
commit 6e83934da0288e9 a182c0f7982871e a5eaff1cec
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 reenInfo, which later calls RRFirstOutput.
ProcRRGetSc
Signed-off-by: Ricardo Salveti de Araujo <email address hidden>
diff --git a/randr/randr.c b/randr/randr.c ScreenPtr pScreen)
index 4d4298a..9432819 100644
--- a/randr/randr.c
+++ b/randr/randr.c
@@ -446,6 +446,9 @@ RRFirstOutput(
RROutputPtr output;
int i, j;
+ if (!pSrcPriv) >primaryOutput && pScrPriv- >primaryOutput- >crtc) >primaryOutput;
+ return NULL;
+
if (pScrPriv-
return pScrPriv-