glsl: Assert input to strcmp is not null.
authorVinson Lee <vlee@vmware.com>
Sat, 27 Feb 2010 08:31:14 +0000 (00:31 -0800)
committerVinson Lee <vlee@vmware.com>
Sat, 27 Feb 2010 08:31:14 +0000 (00:31 -0800)
src/mesa/shader/slang/slang_builtin.c

index 0a9f0b97fb9e1319d6064554912a4dbaace1b2b5..5533cc5b655befa5ecd2a8b7764471441fcfb5db 100644 (file)
@@ -121,6 +121,7 @@ lookup_statevar(const char *var, GLint index1, GLint index2, const char *field,
    }
    else if (strcmp(var, "gl_DepthRange") == 0) {
       tokens[0] = STATE_DEPTH_RANGE;
+      assert(field);
       if (strcmp(field, "near") == 0) {
          *swizzleOut = SWIZZLE_XXXX;
       }