From: Brian Paul Date: Sat, 28 Jun 2008 22:47:39 +0000 (-0600) Subject: mesa: added null ptr checks X-Git-Tag: mesa-7.8~4139^2~390^2~1070 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9d94d133b019ef23ee03cc691fcb5602451604ae;p=platform%2Fupstream%2Fmesa.git mesa: added null ptr checks --- diff --git a/src/mesa/shader/prog_uniform.c b/src/mesa/shader/prog_uniform.c index d96a916..f57df3d 100644 --- a/src/mesa/shader/prog_uniform.c +++ b/src/mesa/shader/prog_uniform.c @@ -119,7 +119,7 @@ GLint _mesa_lookup_uniform(const struct gl_uniform_list *list, const char *name) { GLuint i; - for (i = 0; i < list->NumUniforms; i++) { + for (i = 0; list && i < list->NumUniforms; i++) { if (!_mesa_strcmp(list->Uniforms[i].Name, name)) { return i; } @@ -133,7 +133,7 @@ _mesa_longest_uniform_name(const struct gl_uniform_list *list) { GLint max = 0; GLuint i; - for (i = 0; i < list->NumUniforms; i++) { + for (i = 0; list && i < list->NumUniforms; i++) { GLuint len = _mesa_strlen(list->Uniforms[i].Name); if (len > (GLuint)max) max = len;