[PATCH] VidMode: prevent crash with no modes

Pauli Nieminen ext-pauli.nieminen at nokia.com
Tue Jan 25 03:31:55 PST 2011


On 24/01/11 11:20 +0000, ext Chris Wilson wrote:
> Bugzilla:  https://bugs.freedesktop.org/show_bug.cgi?id=14731

Is bug link correct? 

> Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
> ---
>  hw/xfree86/common/xf86VidMode.c |    3 +++
>  1 files changed, 3 insertions(+), 0 deletions(-)
> 
> diff --git a/hw/xfree86/common/xf86VidMode.c b/hw/xfree86/common/xf86VidMode.c
> index 1788fa1..c22243a 100644
> --- a/hw/xfree86/common/xf86VidMode.c
> +++ b/hw/xfree86/common/xf86VidMode.c
> @@ -221,6 +221,9 @@ VidModeGetFirstModeline(int scrnIndex, pointer *mode, int *dotClock)
>  	return FALSE;
>  
>      pScrn = xf86Screens[scrnIndex];
> +    if (pScrn->modes == NULL)
> +	    return FALSE;
> +

Should we check for missing pScrn->modes in VidModeAvailable?

>      pVidMode = VMPTR(pScrn->pScreen);
>      pVidMode->First = pScrn->modes;
>      pVidMode->Next =  pVidMode->First->next;
> -- 
> 1.7.2.3
> 
> _______________________________________________
> xorg-devel at lists.x.org: X.Org development
> Archives: http://lists.x.org/archives/xorg-devel
> Info: http://lists.x.org/mailman/listinfo/xorg-devel


More information about the xorg-devel mailing list