Fix uninitialized length in X11_GetClipboardData causing test failures (#14322)

(cherry picked from commit 093fbfd867)
This commit is contained in:
DONGGEUN YOO authored and Sam Lantinga committed 2025-10-25 07:42:24 -07:00
1 parent 29f857fed6
commit 3302162ede
1 file changed
+3
+3
View File
@@ -273,6 +273,9 @@ bool X11_SetClipboardData(SDL_VideoDevice *_this)
void *X11_GetClipboardData(SDL_VideoDevice *_this, const char *mime_type, size_t *length)
{
SDL_VideoData *videodata = _this->internal;
*length = 0;
if (!SDL_HasInternalClipboardData(_this, mime_type)) {
// This mime type wasn't advertised by the last selection owner.
// The atom might still have data, but it's stale, so ignore it.