[PATCH] d3dx9: Return an error if no fallback format is found.

Matteo Bruni mbruni at codeweavers.com
Wed Oct 30 04:24:39 CDT 2019


Signed-off-by: Matteo Bruni <mbruni at codeweavers.com>
---
My own take on 172098. I had a patch like this in my queue for years
but I didn't send it earlier because I didn't know anything would be
affected by it. It turns out 172101 is probably the first real case
where it matters.

Supersedes patch 172098 and should go in its place in the patch
series.

 dlls/d3dx9_36/texture.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/dlls/d3dx9_36/texture.c b/dlls/d3dx9_36/texture.c
index 12cb2f3983d..736d11dfad2 100644
--- a/dlls/d3dx9_36/texture.c
+++ b/dlls/d3dx9_36/texture.c
@@ -323,6 +323,11 @@ HRESULT WINAPI D3DXCheckTextureRequirements(struct IDirect3DDevice9 *device, UIN
                 bestfmt = curfmt;
             }
         }
+        if (!bestfmt)
+        {
+            hr = D3DERR_NOTAVAILABLE;
+            goto cleanup;
+        }
         fmt = bestfmt;
         hr = D3D_OK;
     }
-- 
2.21.0




More information about the wine-devel mailing list