From 5ce799b576720acdcf67fedd32172c1b54549eef 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: (cherry picked from commit 788c106ea129880c07efb8d64f27365742e37bf4) --- .pick_status.json | 2 +- src/gallium/frontends/wgl/stw_device.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index 91a929c2193..247e8290ffb 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -894,7 +894,7 @@ "description": "wgl: Initialize DEVMODE struct", "nominated": true, "nomination_type": 0, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": null, "notes": null 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 */