From 41b1efd7ce0b0b80b0a99e814fe62153d9c47b8a Mon Sep 17 00:00:00 2001 From: Jens Peters Date: Fri, 27 Jan 2023 23:06:07 +0100 Subject: [PATCH] [dxgi] Fix potential division by zero in log statement Apparently 0/0 is legal and should be interpreted as 0/1. --- src/dxgi/dxgi_swapchain.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dxgi/dxgi_swapchain.cpp b/src/dxgi/dxgi_swapchain.cpp index e7cd7651..fef525be 100644 --- a/src/dxgi/dxgi_swapchain.cpp +++ b/src/dxgi/dxgi_swapchain.cpp @@ -713,7 +713,7 @@ namespace dxvk { "DXGI: Failed to query closest mode:", "\n Format: ", preferredMode.Format, "\n Mode: ", preferredMode.Width, "x", preferredMode.Height, - "@", preferredMode.RefreshRate.Numerator / preferredMode.RefreshRate.Denominator)); + "@", preferredMode.RefreshRate.Numerator / std::max(preferredMode.RefreshRate.Denominator, 1u))); return hr; }