If GL/Vulkan was loaded manually via a SDL_X_LoadLibrary() call instead of via window flags or through the GPU or renderer system, and there is no matching SDL_X_UnloadLibrary() call, the library instance won't be automatically unloaded while shutting down the video system, as the refcount won't go to zero, which can cause problems with some backends, and leaves a leaked DLL/SO handle when the global video object is destroyed.
Ensure that the libraries are unloaded after destroying the windows, but before shutting down the video backend, to prevent a leak and possible driver errors when shutting down the video backend.
(cherry picked from commit 37fca1fdcf)
Update the HDR data on a placeholder display if it hasn't been finalized and added yet, or the HDR data on the added display will be incorrect.
(cherry picked from commit 235f417616)
An event flush while a window is being hidden may try to toggle the window borders. Don't poll the mapping state when toggling borders if the window is in the process of being hidden, or the window may already be unmapped, and the wait loop will hang forever.
(cherry picked from commit 78d008fcd2)
The script assumed Git's traditional loose refs or packed-refs format.
When cloning with extensions.refstorage=reftable, neither .git/refs/*
nor .git/packed-refs exist, causing cmake configuration to fail.
Fall back to git rev-parse when file-based ref lookup fails.
(cherry picked from commit bdb72bb3f0)
In the unlikely case that the overflow check should fail,
the else clause would switch to the truncated stack message
without updating the len variable. This would contain the
return value from vsnprintf(), meaning it could point beyond
the buffer.
The subsequent code which trims NL and CR from the buffer,
would then read -- and possibly write -- out-of-bounds.
To fix this, we split the two joint conditions into separate
if-clauses, and adjust the len variable in the case where we
know the message buffer was truncated.
(cherry picked from commit 2cb9a4fcc1)
At best, this is a no-op.
At worst, it might:
- Clobber a signal handler someone registered after us
- Overwrite the signal mask or flags
- Cause unregistration to fail (sigaction() isn't guaranteed to return the exact pointer passed to signal())
(cherry picked from commit 6d99204a82)
If this application is being run under Wine but Steam doesn't know that, Steam won't set STEAM_COMPAT_PROTON. So we'll use wine_get_version() to detect that we're running under Wine instead.
(cherry picked from commit e2e8f86076)
Other blitters seem to handle zero width/height destinations correctly.
Signed-off-by: Marcin Serwin <marcin@serwin.dev>
(cherry picked from commit 53ee410d7a)
When the upload needs realignment, a new buffer is created to do the
upload, and the source data is copied to the new buffer. This commit
fixes the issue where the memcopy can read off the end of the source
buffer since it is reading based on destination pitch instead of source
pitch.
(cherry picked from commit 6a01d6e7d3)
Correcting it when it is subsequently hidden and re-mapped will cause the position to be double offset by the size of the borders.
(cherry picked from commit a71b2f0a93)