diff --git a/src/video/x11/SDL_x11clipboard.c b/src/video/x11/SDL_x11clipboard.c index f3e9f372ca..7f083c3f5f 100644 --- a/src/video/x11/SDL_x11clipboard.c +++ b/src/video/x11/SDL_x11clipboard.c @@ -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.