mesa: add _mesa_program_state_value_size() helper
[mesa.git] / src / mesa / swrast / s_aalinetemp.h
index bebb131a5d1e4a3e3fa27c7d2bf4bb7795d30e84..9997d03753adebafef49946ae1fb39b0015e2ca7 100644 (file)
@@ -123,7 +123,7 @@ NAME(line)(struct gl_context *ctx, const SWvertex *v0, const SWvertex *v1)
                                  ctx->Const.MinLineWidthAA,
                                  ctx->Const.MaxLineWidthAA);
 
-   if (line.len == 0.0F || IS_INF_OR_NAN(line.len))
+   if (line.len == 0.0F || util_is_inf_or_nan(line.len))
       return;
 
    INIT_SPAN(line.span, GL_LINE);
@@ -179,10 +179,12 @@ NAME(line)(struct gl_context *ctx, const SWvertex *v0, const SWvertex *v1)
          if (attr >= VARYING_SLOT_TEX0 && attr < VARYING_SLOT_VAR0) {
             const GLuint u = attr - VARYING_SLOT_TEX0;
             const struct gl_texture_object *obj = ctx->Texture.Unit[u]._Current;
-            const struct gl_texture_image *texImage =
-               _mesa_base_tex_image(obj);
-            line.texWidth[attr]  = (GLfloat) texImage->Width;
-            line.texHeight[attr] = (GLfloat) texImage->Height;
+            if (obj) {
+               const struct gl_texture_image *texImage =
+                  _mesa_base_tex_image(obj);
+               line.texWidth[attr]  = (GLfloat) texImage->Width;
+               line.texHeight[attr] = (GLfloat) texImage->Height;
+            }
          }
       ATTRIB_LOOP_END
    }