diff options
author | Brian Paul <[email protected]> | 2018-07-27 12:59:29 -0600 |
---|---|---|
committer | Brian Paul <[email protected]> | 2018-07-27 21:21:24 -0600 |
commit | 90b189e5d2c6ee0408db6a34af0b97ee373a7590 (patch) | |
tree | 3c4f42c26e95dd1e423ac4b078e8aeaf2b7756b4 /src/mesa/swrast | |
parent | ce0f42dfe46cd9a9ae63dd09dd45b2e7f660d001 (diff) |
swrast: fix crash in AA line code when there's no texture
Fixes a crash running the Piglit polygon-mode-facing test (and
probably others).
Reviewed-by: Neha Bhende <[email protected]>
Diffstat (limited to 'src/mesa/swrast')
-rw-r--r-- | src/mesa/swrast/s_aalinetemp.h | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/mesa/swrast/s_aalinetemp.h b/src/mesa/swrast/s_aalinetemp.h index bebb131a5d1..64767a3a564 100644 --- a/src/mesa/swrast/s_aalinetemp.h +++ b/src/mesa/swrast/s_aalinetemp.h @@ -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 } |