Christian Costa : d3dx9_36: Release shader if getting constant table fails in D3DXCompileShader.

Alexandre Julliard julliard at winehq.org
Mon Jul 29 14:01:17 CDT 2013


Module: wine
Branch: master
Commit: a8728893b7ed793a1f57f47e948f838244cdd95b
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=a8728893b7ed793a1f57f47e948f838244cdd95b

Author: Christian Costa <titan.costa at gmail.com>
Date:   Tue Jul 23 08:20:30 2013 +0200

d3dx9_36: Release shader if getting constant table fails in D3DXCompileShader.

---

 dlls/d3dx9_36/shader.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/dlls/d3dx9_36/shader.c b/dlls/d3dx9_36/shader.c
index 15dbb7a..457036b 100644
--- a/dlls/d3dx9_36/shader.c
+++ b/dlls/d3dx9_36/shader.c
@@ -368,7 +368,14 @@ HRESULT WINAPI D3DXCompileShader(const char *data, UINT length, const D3DXMACRO
                     function, profile, flags, 0, (ID3DBlob **)shader, (ID3DBlob **)error_msgs);
 
     if (SUCCEEDED(hr) && constant_table)
+    {
         hr = D3DXGetShaderConstantTable(ID3DXBuffer_GetBufferPointer(*shader), constant_table);
+        if (FAILED(hr))
+        {
+            ID3DXBuffer_Release(*shader);
+            *shader = NULL;
+        }
+    }
 
     return hr;
 }




More information about the wine-cvs mailing list