]> git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
fix crash in SDL mode listing
authordivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Wed, 5 Aug 2009 17:05:37 +0000 (17:05 +0000)
committerdivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Wed, 5 Aug 2009 17:05:37 +0000 (17:05 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@9093 d7cf8633-e32d-0410-b094-e92efae38249

vid_sdl.c

index fe1a3605c71565421eb71faee583db337927ab1f..e6b6eabd8a55a6a9e4b3857e28a486ae32533649 100644 (file)
--- a/vid_sdl.c
+++ b/vid_sdl.c
@@ -811,7 +811,6 @@ void VID_Finish (void)
 
 size_t VID_ListModes(vid_mode_t *modes, size_t maxcount)
 {
-       int i;
        size_t k;
        SDL_Rect **vidmodes;
        int bpp = SDL_GetVideoInfo()->vfmt->BitsPerPixel;
@@ -821,8 +820,8 @@ size_t VID_ListModes(vid_mode_t *modes, size_t maxcount)
        {
                if(k >= maxcount)
                        break;
-               modes[k].width = vidmodes[i]->w;
-               modes[k].height = vidmodes[i]->h;
+               modes[k].width = (*vidmodes)->w;
+               modes[k].height = (*vidmodes)->h;
                modes[k].bpp = bpp;
                modes[k].refreshrate = 60; // no support for refresh rate in SDL
                modes[k].pixelheight_num = 1;