diff --git a/dlls/d3d8/shader.c b/dlls/d3d8/shader.c index 9dfcc0bd277..df59bdfcec4 100644 --- a/dlls/d3d8/shader.c +++ b/dlls/d3d8/shader.c @@ -919,9 +919,10 @@ inline static VOID IDirect3DVertexShaderImpl_ParseProgram(IDirect3DVertexShaderI } /* Generate HW shader in needed */ - if (useHW) + if (useHW && NULL != pFunction) { IDirect3DVertexShaderImpl_GenerateProgramArbHW(vshader, pFunction); - + } + /* copy the function ... because it will certainly be released by application */ if (NULL != pFunction) { vshader->function = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, vshader->functionLength);