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.
This commit is contained in:
Henri Verbeet 2009-03-24 10:09:21 +01:00 committed by Alexandre Julliard
parent bdd1206ca5
commit 8ce2506aa8
2 changed files with 4 additions and 2 deletions

View File

@ -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");
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_array = HeapReAlloc(GetProcessHeap(), 0, shader->gl_shaders,
new_size * sizeof(*shader->gl_shaders));

View File

@ -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");
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_array = HeapReAlloc(GetProcessHeap(), 0, shader->gl_shaders,
new_size * sizeof(*shader->gl_shaders));