[PATCH] Avoid segfaults in XF86VidMode GammaRamp functions if randr_crtc is NULL

Keith Packard keithp at keithp.com
Tue Jan 26 23:17:35 PST 2010


On Tue, 26 Jan 2010 22:25:04 -0800, Alan Coopersmith <alan.coopersmith at sun.com> wrote:

> Fixes crash when xscreensaver tries to use GammaRamp calls to fade out
> http://bugs.opensolaris.org/bugdatabase/view_bug.do?bug_id=6915712

This seems odd to me; how can you have a crtc and no randr_crtc?

> @@ -1077,7 +1079,8 @@ xf86GetGammaRampSize(ScreenPtr pScreen)
>  	xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn);
>  	RRCrtcPtr crtc = config->output[config->compat_output]->crtc->randr_crtc;
>  
> -	return crtc->gammaSize;
> +	if (crtc)
> +	    return crtc->gammaSize;

Uh, what's the return value if you don't have a crtc?

-- 
keith.packard at intel.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.x.org/archives/xorg-devel/attachments/20100126/e94aa7a4/attachment-0001.pgp 


More information about the xorg-devel mailing list