From: divverent Date: Sat, 13 Nov 2010 14:07:13 +0000 (+0000) Subject: avoid NULL pointer access if a surface had an unsupported type X-Git-Tag: xonotic-v0.1.0preview~70 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=0242b840d2d8008e68dba6a21fa3dbda2b31c3b0;p=xonotic%2Fdarkplaces.git avoid NULL pointer access if a surface had an unsupported type git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10596 d7cf8633-e32d-0410-b094-e92efae38249 ::stable-branch::merge=a0c28f5d37f75edd41a377b6eee32fa932097151 --- diff --git a/model_brush.c b/model_brush.c index d16d67eb..627764fc 100644 --- a/model_brush.c +++ b/model_brush.c @@ -5320,12 +5320,12 @@ static void Mod_Q3BSP_LoadFaces(lump_t *l) continue; if(out->num_vertices == 0) { - Con_Printf("Mod_Q3BSP_LoadFaces: surface %d (texture %s) has no vertices, ignoring\n", i, out->texture->name); + Con_Printf("Mod_Q3BSP_LoadFaces: surface %d (texture %s) has no vertices, ignoring\n", i, out->texture ? out->texture->name : "(none)"); if(out->num_triangles == 0) - Con_Printf("Mod_Q3BSP_LoadFaces: surface %d (texture %s) has no triangles, ignoring\n", i, out->texture->name); + Con_Printf("Mod_Q3BSP_LoadFaces: surface %d (texture %s) has no triangles, ignoring\n", i, out->texture ? out->texture->name : "(none)"); } else if(out->num_triangles == 0) - Con_Printf("Mod_Q3BSP_LoadFaces: surface %d (texture %s, near %f %f %f) has no triangles, ignoring\n", i, out->texture->name, + Con_Printf("Mod_Q3BSP_LoadFaces: surface %d (texture %s, near %f %f %f) has no triangles, ignoring\n", i, out->texture ? out->texture->name : "(none)", (loadmodel->surfmesh.data_vertex3f + 3 * out->num_firstvertex)[0 * 3 + 0], (loadmodel->surfmesh.data_vertex3f + 3 * out->num_firstvertex)[1 * 3 + 0], (loadmodel->surfmesh.data_vertex3f + 3 * out->num_firstvertex)[2 * 3 + 0]);