diff --git a/gfx/common/win32_common.cpp b/gfx/common/win32_common.cpp index 1492b6cd83..92e8bdf322 100644 --- a/gfx/common/win32_common.cpp +++ b/gfx/common/win32_common.cpp @@ -1059,6 +1059,7 @@ void win32_get_video_output_prev( { DEVMODE dm; int iModeNum; + bool found = false; unsigned prev_width = 0; unsigned prev_height = 0; unsigned curr_width = 0; @@ -1075,8 +1076,7 @@ void win32_get_video_output_prev( { if (prev_width != curr_width && prev_height != curr_height) { - *width = dm.dmPelsWidth; - *height = dm.dmPelsHeight; + found = true; break; } } @@ -1084,6 +1084,12 @@ void win32_get_video_output_prev( prev_width = dm.dmPelsWidth; prev_height = dm.dmPelsHeight; } + + if (found) + { + *width = prev_width; + *height = prev_height; + } } void win32_get_video_output_size(unsigned *width, unsigned *height)