Correct a NULL pointer deference

The problem happens if Monitor/Card combo doesn't provide EDID info,
and the XFree86-VidModeExtension extension is used.

Signed-off-by: Peter Hutterer <peter@cs.unisa.edu.au>
This commit is contained in:
Paulo Cesar Pereira de Andrade 2008-05-23 13:50:39 -03:00 committed by Peter Hutterer
parent 3a1278907e
commit c8af7ce35a

View File

@ -150,10 +150,14 @@ VidModeGetCurrentModeline(int scrnIndex, pointer *mode, int *dotClock)
return FALSE;
pScrn = xf86Screens[scrnIndex];
*mode = (pointer)(pScrn->currentMode);
*dotClock = pScrn->currentMode->Clock;
return TRUE;
if (pScrn->currentMode) {
*mode = (pointer)(pScrn->currentMode);
*dotClock = pScrn->currentMode->Clock;
return TRUE;
}
return FALSE;
}
_X_EXPORT int