From bd2fb9ebaf86448a216b47a2b6e25650e3fb52cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Camilla=20L=C3=B6wy?= Date: Wed, 15 Jul 2020 21:56:52 +0200 Subject: [PATCH] Wayland: Fix partial framebuffer size retrieval (cherry picked from commit 5f60c22cfa5c3d62e2cb2f281fd057384fc58f54) --- README.md | 1 + src/wl_window.c | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 3a269d40..5e16933e 100644 --- a/README.md +++ b/README.md @@ -135,6 +135,7 @@ information on what to include when reporting a bug. - [X11] Bugfix: Keys pressed simultaneously with others were not always reported (#1112,#1415,#1472,#1616) - [Wayland] Bugfix: Repeated keys could be reported with `NULL` window (#1704) + - [Wayland] Bugfix: Retrieving partial framebuffer size would segfault ## Contact diff --git a/src/wl_window.c b/src/wl_window.c index 0cc725a5..f811fffc 100644 --- a/src/wl_window.c +++ b/src/wl_window.c @@ -1118,8 +1118,10 @@ void _glfwPlatformGetFramebufferSize(_GLFWwindow* window, int* width, int* height) { _glfwPlatformGetWindowSize(window, width, height); - *width *= window->wl.scale; - *height *= window->wl.scale; + if (width) + *width *= window->wl.scale; + if (height) + *height *= window->wl.scale; } void _glfwPlatformGetWindowFrameSize(_GLFWwindow* window,