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:
@@ -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 */
|
||||
|
||||
Reference in New Issue
Block a user