mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-05-08 23:01:58 +00:00
If a size change occurs, the sdl2-compat event handler will flush the renderer, which will cause the software renderer to re-acquire a surface that was invalidated due to the size change. However, if the OnWindowPixelSizeChanged handler is called afterward, the invalid flag will be set on the surface, causing presentation to fail.
Check both for a null surface pointer and an invalid surface flag when checking surface validity in the software renderer.
(cherry picked from commit 73fc274ef7)