From e957a0c9e7fde0668d33ce5e43e123a18aad07f7 Mon Sep 17 00:00:00 2001 From: divverent Date: Fri, 30 Oct 2009 18:10:15 +0000 Subject: [PATCH] fix bug with bogus refresh rate info in xvidmode data git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@9403 d7cf8633-e32d-0410-b094-e92efae38249 --- vid_glx.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/vid_glx.c b/vid_glx.c index a0284127..9bbf5bcb 100644 --- a/vid_glx.c +++ b/vid_glx.c @@ -1102,7 +1102,10 @@ size_t VID_ListModes(vid_mode_t *modes, size_t maxcount) modes[k].width = vidmodes[i]->hdisplay; modes[k].height = vidmodes[i]->vdisplay; modes[k].bpp = 8; - modes[k].refreshrate = vidmodes[i]->dotclock / vidmodes[i]->htotal / vidmodes[i]->vtotal; + if(vidmodes[i]->dotclock && vidmodes[i]->htotal && vidmodes[i]->vtotal) + modes[k].refreshrate = vidmodes[i]->dotclock / vidmodes[i]->htotal / vidmodes[i]->vtotal; + else + modes[k].refreshrate = 60; modes[k].pixelheight_num = 1; modes[k].pixelheight_denom = 1; // xvidmode does not provide this ++k; -- 2.39.2