[Scummvm-git-logs] scummvm master -> 23ca3604b80d375aa31e4bbd410c8749978570ef
criezy
criezy at scummvm.org
Mon Jul 26 22:18:32 UTC 2021
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
23ca3604b8 SDL: Fix crash when switching to a 3D graphics manager
Commit: 23ca3604b80d375aa31e4bbd410c8749978570ef
https://github.com/scummvm/scummvm/commit/23ca3604b80d375aa31e4bbd410c8749978570ef
Author: Thierry Crozat (criezy at scummvm.org)
Date: 2021-07-26T23:18:17+01:00
Commit Message:
SDL: Fix crash when switching to a 3D graphics manager
The OpenGLSdlGraphics3dManager::getSupportedFormats() implementation
returns an empty list. This caused a crash when trying to get the
first element of the list in SdlGraphicsManager::setState().
This fixes bug #12762: The longest Journey crashes
Changed paths:
backends/graphics/sdl/sdl-graphics.cpp
diff --git a/backends/graphics/sdl/sdl-graphics.cpp b/backends/graphics/sdl/sdl-graphics.cpp
index cada88d1bb..44464242f6 100644
--- a/backends/graphics/sdl/sdl-graphics.cpp
+++ b/backends/graphics/sdl/sdl-graphics.cpp
@@ -85,7 +85,7 @@ bool SdlGraphicsManager::setState(const State &state) {
// pixel format instead.
Graphics::PixelFormat format = state.pixelFormat;
Common::List<Graphics::PixelFormat> supportedFormats = getSupportedFormats();
- if (Common::find(supportedFormats.begin(), supportedFormats.end(), format) == supportedFormats.end())
+ if (!supportedFormats.empty() && Common::find(supportedFormats.begin(), supportedFormats.end(), format) == supportedFormats.end())
format = supportedFormats.front();
initSize(state.screenWidth, state.screenHeight, &format);
#else
More information about the Scummvm-git-logs
mailing list