mirror of
https://github.com/SFML/SFML.git
synced 2024-11-28 22:31:09 +08:00
Applied ZeroMemory to DEVMODE struct n Win32 to prevent Uninitialized Read.
Set dmDriverExtra for EnumDisplaySettings. Reverted unneeded ZeroMemory for DEVMODE.
This commit is contained in:
parent
a2f448ab4c
commit
23a345512d
@ -42,6 +42,7 @@ std::vector<VideoMode> VideoModeImpl::getFullscreenModes()
|
|||||||
// Enumerate all available video modes for the primary display adapter
|
// Enumerate all available video modes for the primary display adapter
|
||||||
DEVMODE win32Mode;
|
DEVMODE win32Mode;
|
||||||
win32Mode.dmSize = sizeof(win32Mode);
|
win32Mode.dmSize = sizeof(win32Mode);
|
||||||
|
win32Mode.dmDriverExtra = 0;
|
||||||
for (int count = 0; EnumDisplaySettings(NULL, count, &win32Mode); ++count)
|
for (int count = 0; EnumDisplaySettings(NULL, count, &win32Mode); ++count)
|
||||||
{
|
{
|
||||||
// Convert to sf::VideoMode
|
// Convert to sf::VideoMode
|
||||||
@ -61,6 +62,7 @@ VideoMode VideoModeImpl::getDesktopMode()
|
|||||||
{
|
{
|
||||||
DEVMODE win32Mode;
|
DEVMODE win32Mode;
|
||||||
win32Mode.dmSize = sizeof(win32Mode);
|
win32Mode.dmSize = sizeof(win32Mode);
|
||||||
|
win32Mode.dmDriverExtra = 0;
|
||||||
EnumDisplaySettings(NULL, ENUM_CURRENT_SETTINGS, &win32Mode);
|
EnumDisplaySettings(NULL, ENUM_CURRENT_SETTINGS, &win32Mode);
|
||||||
|
|
||||||
return VideoMode(win32Mode.dmPelsWidth, win32Mode.dmPelsHeight, win32Mode.dmBitsPerPel);
|
return VideoMode(win32Mode.dmPelsWidth, win32Mode.dmPelsHeight, win32Mode.dmBitsPerPel);
|
||||||
|
Loading…
Reference in New Issue
Block a user