소스 검색

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

(cherry picked from commit 093fbfd867a574359ea0d987adb78cdda935688c)
DONGGEUN YOO 6 달 전
부모
커밋
3302162ede
1개의 변경된 파일3개의 추가작업 그리고 0개의 파일을 삭제
  1. 3 0
      src/video/x11/SDL_x11clipboard.c

+ 3 - 0
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.