From 424c7e7adf056e328c60241c18e28f32558ebeac Mon Sep 17 00:00:00 2001 From: momo5502 Date: Fri, 23 Jun 2017 10:05:05 +0200 Subject: [PATCH] [D3D9Ex] Make sure the creation succeeded --- src/Components/Modules/D3D9Ex.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Components/Modules/D3D9Ex.cpp b/src/Components/Modules/D3D9Ex.cpp index d5281324..b1028c2b 100644 --- a/src/Components/Modules/D3D9Ex.cpp +++ b/src/Components/Modules/D3D9Ex.cpp @@ -733,8 +733,9 @@ namespace Components { if (Dvar::Var("r_useD3D9Ex").get()) { - IDirect3D9Ex* test; - Direct3DCreate9Ex(sdk, &test); + IDirect3D9Ex* test = nullptr; + if (FAILED(Direct3DCreate9Ex(sdk, &test))) return nullptr; + return (new D3D9Ex::D3D9(test)); } else