Skip to content

Commit

Permalink
Defend against empty textures.
Browse files Browse the repository at this point in the history
E.g. __TB_empty in qbj_grue.bsp
See Novum/vkQuake#567
  • Loading branch information
temx authored and sezero committed Oct 1, 2022
1 parent 58ea3ad commit 789fbdd
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Quake/gl_model.c
Original file line number Diff line number Diff line change
Expand Up @@ -496,6 +496,12 @@ static void Mod_LoadTextures (lump_t *l)
for (j=0 ; j<MIPLEVELS ; j++)
mt->offsets[j] = LittleLong (mt->offsets[j]);

if (mt->width == 0 || mt->height == 0)
{
Con_Warning ("Zero sized texture %s in %s!\n", mt->name, loadmodel->name);
continue;
}

if ( (mt->width & 15) || (mt->height & 15) )
{
if (loadmodel->bspversion != BSPVERSION_QUAKE64)
Expand Down

0 comments on commit 789fbdd

Please sign in to comment.