Skip to content

Commit 093fbfd

Browse files
authored
Fix uninitialized length in X11_GetClipboardData causing test failures (#14322)
1 parent ac0915b commit 093fbfd

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/video/x11/SDL_x11clipboard.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,9 @@ bool X11_SetClipboardData(SDL_VideoDevice *_this)
273273
void *X11_GetClipboardData(SDL_VideoDevice *_this, const char *mime_type, size_t *length)
274274
{
275275
SDL_VideoData *videodata = _this->internal;
276+
277+
*length = 0;
278+
276279
if (!SDL_HasInternalClipboardData(_this, mime_type)) {
277280
// This mime type wasn't advertised by the last selection owner.
278281
// The atom might still have data, but it's stale, so ignore it.

0 commit comments

Comments
 (0)