Windows 8.1 and older allow setting a display mode with 0bit color depth.
Fix a regression from 981fb4edb371dd2ccf57dd350e76451df50c0a98.
Signed-off-by: Zhiyi Zhang zzhang@codeweavers.com --- This is already tested in user32/tests/monitor.c#test_ChangeDisplaySettingsEx() vid_modes_test[3]. But the test is marked as not must succeed because different Windows versions may return different results. So the TestBots didn't catch this one.
dlls/winex11.drv/settings.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/dlls/winex11.drv/settings.c b/dlls/winex11.drv/settings.c index 7827ede6560..902f1ec15d9 100644 --- a/dlls/winex11.drv/settings.c +++ b/dlls/winex11.drv/settings.c @@ -473,7 +473,9 @@ static DEVMODEW *get_full_mode(ULONG_PTR id, DEVMODEW *dev_mode) { found_mode = (DEVMODEW *)((BYTE *)modes + (sizeof(*modes) + modes[0].dmDriverExtra) * mode_idx);
- if (dev_mode->dmFields & DM_BITSPERPEL && found_mode->dmBitsPerPel != dev_mode->dmBitsPerPel) + if (dev_mode->dmFields & DM_BITSPERPEL && + dev_mode->dmBitsPerPel && + found_mode->dmBitsPerPel != dev_mode->dmBitsPerPel) continue; if (dev_mode->dmFields & DM_PELSWIDTH && found_mode->dmPelsWidth != dev_mode->dmPelsWidth) continue;