From b938a839e0a4a7616de1164432ae05127fbc5a93 Mon Sep 17 00:00:00 2001 From: Nevyn Bengtsson Date: Wed, 5 Aug 2020 14:48:58 +0200 Subject: [PATCH] fix crash in lovrGraphicsGetPixelDensity Neither Quest nor Pico check for null on its out-params. Better to send in dummy params to avoid nulls. --- src/modules/graphics/graphics.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/modules/graphics/graphics.c b/src/modules/graphics/graphics.c index 5adb9f39..4accc927 100644 --- a/src/modules/graphics/graphics.c +++ b/src/modules/graphics/graphics.c @@ -279,9 +279,9 @@ int lovrGraphicsGetHeight() { } float lovrGraphicsGetPixelDensity() { - int width, framebufferWidth; - lovrPlatformGetWindowSize(&width, NULL); - lovrPlatformGetFramebufferSize(&framebufferWidth, NULL); + int width, height, framebufferWidth, framebufferHeight; + lovrPlatformGetWindowSize(&width, &height); + lovrPlatformGetFramebufferSize(&framebufferWidth, &framebufferHeight); if (width == 0 || framebufferWidth == 0) { return 0.f; } else {