[PATCH xserver] xfree86/modes: Use xf86ScrnToScreen in xf86RandR12LoadPalette

Michel Dänzer michel at daenzer.net
Fri Jul 29 08:09:39 UTC 2016


From: Michel Dänzer <michel.daenzer at amd.com>

Fixes crash in ScreenInit -> xf86HandleColormaps ->
xf86RandR12LoadPalette with drivers which don't assign pScrn->pScreen
in ScreenInit.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97124
Signed-off-by: Michel Dänzer <michel.daenzer at amd.com>
---
 hw/xfree86/modes/xf86RandR12.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/xfree86/modes/xf86RandR12.c b/hw/xfree86/modes/xf86RandR12.c
index 1e9cbd3..4e0e4a8 100644
--- a/hw/xfree86/modes/xf86RandR12.c
+++ b/hw/xfree86/modes/xf86RandR12.c
@@ -1858,7 +1858,7 @@ void
 xf86RandR12LoadPalette(ScrnInfoPtr pScrn, int numColors, int *indices,
                        LOCO *colors, VisualPtr pVisual)
 {
-    ScreenPtr pScreen = pScrn->pScreen;
+    ScreenPtr pScreen = xf86ScrnToScreen(pScrn);
     XF86RandRInfoPtr randrp = XF86RANDRINFO(pScreen);
     xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn);
     int reds, greens, blues, index, palette_size;
-- 
2.8.1



More information about the xorg-devel mailing list