Commit fba32ee21faeb497549e2feabd6598c23e837192

Ozkan Sezer 2020-10-14T23:01:04

OS2_VideoInit: zero the stSDLDisplay and stSDLDisplayMode variables Fixes testdisplayinfo.exe crashing in SDL2-2.0.13. (How it did work before?..)

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/src/video/os2/SDL_os2video.c b/src/video/os2/SDL_os2video.c
index 662c67f..60c112a 100644
--- a/src/video/os2/SDL_os2video.c
+++ b/src/video/os2/SDL_os2video.c
@@ -1555,6 +1555,8 @@ static int OS2_VideoInit(_THIS)
       return SDL_SetError( "Video mode query failed." );
     }
 
+    SDL_zero(stSDLDisplay); SDL_zero(stSDLDisplayMode);
+
     stSDLDisplayMode.format = _getSDLPixelFormat( stVOInfo.ulBPP,
                                                   stVOInfo.fccColorEncoding );
     stSDLDisplayMode.w = stVOInfo.ulHorizResolution;