Commit 8ce2506a authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

wined3d: Try to make Coverity shut up (CID 863, 905).

Comparing gl_shaders against NULL after potentially dereferencing it a few lines earlier probably confuses Coverity. Checking num_gl_shaders instead should avoid this.
parent bdd1206c
...@@ -530,7 +530,8 @@ GLuint find_gl_pshader(IWineD3DPixelShaderImpl *shader, const struct ps_compile_ ...@@ -530,7 +530,8 @@ GLuint find_gl_pshader(IWineD3DPixelShaderImpl *shader, const struct ps_compile_
TRACE("No matching GL shader found, compiling a new shader\n"); TRACE("No matching GL shader found, compiling a new shader\n");
if(shader->shader_array_size == shader->num_gl_shaders) { if(shader->shader_array_size == shader->num_gl_shaders) {
if(shader->gl_shaders) { if (shader->num_gl_shaders)
{
new_size = shader->shader_array_size + max(1, shader->shader_array_size / 2); new_size = shader->shader_array_size + max(1, shader->shader_array_size / 2);
new_array = HeapReAlloc(GetProcessHeap(), 0, shader->gl_shaders, new_array = HeapReAlloc(GetProcessHeap(), 0, shader->gl_shaders,
new_size * sizeof(*shader->gl_shaders)); new_size * sizeof(*shader->gl_shaders));
......
...@@ -465,7 +465,8 @@ GLuint find_gl_vshader(IWineD3DVertexShaderImpl *shader, const struct vs_compile ...@@ -465,7 +465,8 @@ GLuint find_gl_vshader(IWineD3DVertexShaderImpl *shader, const struct vs_compile
TRACE("No matching GL shader found, compiling a new shader\n"); TRACE("No matching GL shader found, compiling a new shader\n");
if(shader->shader_array_size == shader->num_gl_shaders) { if(shader->shader_array_size == shader->num_gl_shaders) {
if(shader->gl_shaders) { if (shader->num_gl_shaders)
{
new_size = shader->shader_array_size + max(1, shader->shader_array_size / 2); new_size = shader->shader_array_size + max(1, shader->shader_array_size / 2);
new_array = HeapReAlloc(GetProcessHeap(), 0, shader->gl_shaders, new_array = HeapReAlloc(GetProcessHeap(), 0, shader->gl_shaders,
new_size * sizeof(*shader->gl_shaders)); new_size * sizeof(*shader->gl_shaders));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment