diff options
Diffstat (limited to 'uwac/libuwac')
-rw-r--r-- | uwac/libuwac/uwac-input.c | 4 | ||||
-rw-r--r-- | uwac/libuwac/uwac-window.c | 2 |
2 files changed, 5 insertions, 1 deletions
diff --git a/uwac/libuwac/uwac-input.c b/uwac/libuwac/uwac-input.c index 5ad52ae..b11b1a4 100644 --- a/uwac/libuwac/uwac-input.c +++ b/uwac/libuwac/uwac-input.c @@ -818,6 +818,8 @@ static void pointer_handle_motion(void* data, struct wl_pointer* pointer, uint32 assert(input); UwacWindow* window = input->pointer_focus; + if (!window || !window->display) + return; int scale = window->display->actual_scale; int sx_i = wl_fixed_to_int(sx_w) * scale; @@ -825,7 +827,7 @@ static void pointer_handle_motion(void* data, struct wl_pointer* pointer, uint32 double sx_d = wl_fixed_to_double(sx_w) * scale; double sy_d = wl_fixed_to_double(sy_w) * scale; - if (!window || (sx_i < 0) || (sy_i < 0)) + if ((sx_i < 0) || (sy_i < 0)) return; input->sx = sx_d; diff --git a/uwac/libuwac/uwac-window.c b/uwac/libuwac/uwac-window.c index 49728bd..90669aa 100644 --- a/uwac/libuwac/uwac-window.c +++ b/uwac/libuwac/uwac-window.c @@ -379,6 +379,8 @@ int UwacWindowShmAllocBuffers(UwacWindow* w, int nbuffers, int allocSize, uint32 wl_shm_pool_destroy(pool); w->nbuffers += nbuffers; + munmap(data, 1ull * allocSize * nbuffers); + error_mmap: close(fd); return ret; |