瀏覽代碼

wayland: assert that mmap() didn't return NULL.

In practice, it never _would_, but in theory it _might_, so this assertion
tells the static analyzer not to worry about it.
Ryan C. Gordon 5 年之前
父節點
當前提交
22da9d4d77
共有 1 個文件被更改,包括 2 次插入0 次删除
  1. 2 0
      src/video/wayland/SDL_waylandmouse.c

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

@@ -125,6 +125,8 @@ create_buffer_from_shm(Wayland_CursorData *d,
         return SDL_SetError("mmap() failed.");
     }
 
+    SDL_assert(d->shm_data != NULL);
+
     shm_pool = wl_shm_create_pool(data->shm, shm_fd, size);
     d->buffer = wl_shm_pool_create_buffer(shm_pool,
                                           0,