From 788c106ea129880c07efb8d64f27365742e37bf4 Mon Sep 17 00:00:00 2001 From: Jesse Natalie Date: Tue, 5 Mar 2024 13:09:48 -0800 Subject: [PATCH] wgl: Initialize DEVMODE struct Otherwise the dmDriverExtra field might be uninitialized and have a nonzero value, which can cause the API implementation to smash the stack when copying to the output struct. Cc: mesa-stable Reviewed-by: Joshua Ashton Reviewed-by: Erik Faye-Lund Part-of: --- src/gallium/frontends/wgl/stw_device.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gallium/frontends/wgl/stw_device.c b/src/gallium/frontends/wgl/stw_device.c index 655ae68be48..5261028d73d 100644 --- a/src/gallium/frontends/wgl/stw_device.c +++ b/src/gallium/frontends/wgl/stw_device.c @@ -74,7 +74,7 @@ static int get_refresh_rate(void) { #ifndef _GAMING_XBOX - DEVMODE devModes; + DEVMODE devModes = { .dmSize = sizeof(DEVMODE) }; if (EnumDisplaySettings(NULL, ENUM_CURRENT_SETTINGS, &devModes)) { /* clamp the value, just in case we get garbage */