d3dx9_36: Release shader if getting constant table fails in D3DXCompileShader.
This commit is contained in:
parent
531f795623
commit
a8728893b7
|
@ -368,7 +368,14 @@ HRESULT WINAPI D3DXCompileShader(const char *data, UINT length, const D3DXMACRO
|
||||||
function, profile, flags, 0, (ID3DBlob **)shader, (ID3DBlob **)error_msgs);
|
function, profile, flags, 0, (ID3DBlob **)shader, (ID3DBlob **)error_msgs);
|
||||||
|
|
||||||
if (SUCCEEDED(hr) && constant_table)
|
if (SUCCEEDED(hr) && constant_table)
|
||||||
|
{
|
||||||
hr = D3DXGetShaderConstantTable(ID3DXBuffer_GetBufferPointer(*shader), constant_table);
|
hr = D3DXGetShaderConstantTable(ID3DXBuffer_GetBufferPointer(*shader), constant_table);
|
||||||
|
if (FAILED(hr))
|
||||||
|
{
|
||||||
|
ID3DXBuffer_Release(*shader);
|
||||||
|
*shader = NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return hr;
|
return hr;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue