Crash when increasing max zoom #8977
Version of OpenTTD
Crash. Backtrace below.
Steps to reproduce
I increased max zoom from "normal" to 4x from the settings window inside a game. OpenTTD crashed immediately.
The game contains various grfs featuring both extra-zoom (Timberwolf's) and normal-zoom sprites. All should be on BaNaNaS.
I could intermittently reproduce this by loading crash.sav and then adjusting the zoom level. Sometimes the game crashed when changing it in either direction (normal to 4x or vice versa). Sometimes I got no crash, but a "[foo] contains corrupt sprites, showing '?' instead" error dialog, where [foo] was opengfx1 in one case and timberwolf_uk in another.
The text was updated successfully, but these errors were encountered:
Is this with OpenGL (hardware acceleration) on or off?
I managed to reproduce it once on the 1.11 release with the title save with OpenGL on and got an unusually exciting stack trace.
WarnCorruptSprite is called, which creates an error message window, this attempts to show some text, loading a glyph sprite fails, loading the fallback sprite fails, which calls usererror, which calls VideoDriver_SDL_OpenGL::Stop which crashes inside OpenGL, there's then a crash when saving the linkgraph chunks in the crash savegame.
I suspect that this is related to the race conditions associated with cursor sprites in OpenGL (this is one of the issues in #8870).
I do have a fix for the cursor issue and some of the other race conditions in my branch, but they need tidying up a bit before I can PR them.