(svn r7332) -Fix: segmentation fault, discovered by ln-, in the SDL video driver when one goes to fullscreen and there are no suitable resolutions.

This commit is contained in:
rubidium
2006-12-03 17:42:56 +00:00
parent f3358b9813
commit 32ac800be6
2 changed files with 9 additions and 2 deletions

View File

@@ -495,7 +495,7 @@ static void SdlVideoFullScreen(bool full_screen)
{
_fullscreen = full_screen;
GetVideoModes(); // get the list of available video modes
if (!_video_driver->change_resolution(_cur_resolution[0], _cur_resolution[1])) {
if (_num_resolutions == 0 || !_video_driver->change_resolution(_cur_resolution[0], _cur_resolution[1])) {
// switching resolution failed, put back full_screen to original status
_fullscreen ^= true;
}