Bug 13308: Verify and reject obviously broken modes.

This commit is contained in:
Hong Liu 2007-12-05 17:48:28 +01:00 committed by Matthias Hopf
parent 8d0efe4c2a
commit c6cfcd408d

View File

@ -328,6 +328,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. */