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 <joshua@froggi.es>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27998>
This commit is contained in:
Jesse Natalie
2024-03-05 13:09:48 -08:00
committed by Marge Bot
parent d1cf01dc52
commit 788c106ea1
+1 -1
View File
@@ -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 */