Bug 13308: Verify and reject obviously broken modes.

(cherry picked from commit c6cfcd408d)
This commit is contained in:
Hong Liu 2007-12-05 17:48:28 +01:00 committed by Daniel Stone
parent d63efecc94
commit f4bcb53e86

View File

@ -239,6 +239,12 @@ DDCModeFromDetailedTiming(int scrnIndex, struct detailed_timings *timing,
Mode->VSyncEnd = Mode->VSyncStart + timing->v_sync_width;
Mode->VTotal = timing->v_active + timing->v_blanking;
/* perform basic check on the detail timing */
if (Mode->HSyncEnd > Mode->HTotal || Mode->VSyncEnd > Mode->VTotal) {
xfree(Mode);
return NULL;
}
xf86SetModeDefaultName(Mode);
/* We ignore h/v_size and h/v_border for now. */