소스 검색

wayland: Bail out if a null cached cursor is returned

Frank Praznik 1 년 전
부모
커밋
0e37bc7c3f
1개의 변경된 파일3개의 추가작업 그리고 0개의 파일을 삭제
  1. 3 0
      src/video/wayland/SDL_waylandmouse.c

+ 3 - 0
src/video/wayland/SDL_waylandmouse.c

@@ -718,6 +718,9 @@ static int Wayland_ShowCursor(SDL_Cursor *cursor)
             }
         } else {
             Wayland_CachedCustomCursor *cached = Wayland_GetCachedCustomCursor(cursor);
+            if (!cached) {
+                return -1;
+            }
             dst_width = cached->dst_width;
             dst_height = cached->dst_height;
             scale = cached->scale;