From bb2e88ee0692cc3b7fed0516a35bfe51f3323296 Mon Sep 17 00:00:00 2001 From: Joshua Ashton Date: Wed, 25 Mar 2020 07:23:17 +0000 Subject: [PATCH] [d3d9] Fix crash when calling ColorFill with NULL format Impacts #1528 --- src/d3d9/d3d9_device.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/d3d9/d3d9_device.cpp b/src/d3d9/d3d9_device.cpp index 124dd2749..db7734f64 100644 --- a/src/d3d9/d3d9_device.cpp +++ b/src/d3d9/d3d9_device.cpp @@ -1066,8 +1066,13 @@ namespace dxvk { cClearValue); }); } else { - if (unlikely(rtView == nullptr)) - Logger::err(str::format("D3D9DeviceEx::ColorFill: Unsupported format ", dstTextureInfo->Desc()->Format)); + if (unlikely(rtView == nullptr)) { + const D3D9Format format = dstTextureInfo->Desc()->Format; + if (format != D3D9Format::NULL_FORMAT) + Logger::err(str::format("D3D9DeviceEx::ColorFill: Unsupported format ", format)); + + return D3D_OK; + } EmitCs([ cImageView = rtView,