diff options
author | Kent Mein <mein@cs.umn.edu> | 2009-06-14 02:31:14 +0400 |
---|---|---|
committer | Kent Mein <mein@cs.umn.edu> | 2009-06-14 02:31:14 +0400 |
commit | bde991df9ed2d9a1bd54eecd09eb6a7ab0bea4fc (patch) | |
tree | 0a3b5b011d774ac91f35bdbbb2e7fe33f23aa81f /source/blender | |
parent | 472239cc948443e8265fc6359834225214ae03c5 (diff) |
coverity issue CID: 275
Checker: FORWARD_NULL (help)
File: base/src/source/blender/gpu/intern/gpu_extensions.c
Function: GPU_shader_create
Description: Variable "fragcode" tracked as NULL was passed to a function that dereferences it.
fix provided by Brecht. :)
Kent
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/gpu/intern/gpu_extensions.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/source/blender/gpu/intern/gpu_extensions.c b/source/blender/gpu/intern/gpu_extensions.c index 7654c67419b..70192f44ceb 100644 --- a/source/blender/gpu/intern/gpu_extensions.c +++ b/source/blender/gpu/intern/gpu_extensions.c @@ -746,7 +746,9 @@ GPUShader *GPU_shader_create(const char *vertexcode, const char *fragcode, /*GPU glGetObjectParameterivARB(shader->object, GL_OBJECT_LINK_STATUS_ARB, &status); if (!status) { glGetInfoLogARB(shader->object, sizeof(log), &length, log); - shader_print_errors("linking", log, fragcode); + if (fragecode) shader_print_errors("linking", log, fragcode); + else if (vertexcode) shader_print_errors("linking", log, vertexcode); + else if (libcode) shader_print_errors("linking", log, libcode); GPU_shader_free(shader); return NULL; |