[v2 PATCH 2/3] d3dx10: Check device in d3dx10_sprite_GetDevice().

Matteo Bruni mbruni at codeweavers.com
Wed Aug 25 12:36:51 CDT 2021


From: Nikolay Sivov <nsivov at codeweavers.com>

Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
Signed-off-by: Matteo Bruni <mbruni at codeweavers.com>
---
v2 (Matteo): Split out from the test patch. I dislike when a
supposedly "tests" patch also touches the implementation. This one
seemed innocuous enough but might as well split it up anyway.

 dlls/d3dx10_43/sprite.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/dlls/d3dx10_43/sprite.c b/dlls/d3dx10_43/sprite.c
index c90185e0c0a..5fc9b9edaa2 100644
--- a/dlls/d3dx10_43/sprite.c
+++ b/dlls/d3dx10_43/sprite.c
@@ -157,6 +157,9 @@ static HRESULT WINAPI d3dx10_sprite_GetDevice(ID3DX10Sprite *iface, ID3D10Device
 
     TRACE("iface %p, device %p.\n", iface, device);
 
+    if (!device)
+        return E_FAIL;
+
     *device = sprite->device;
     ID3D10Device_AddRef(*device);
 
-- 
2.26.3




More information about the wine-devel mailing list