diff --git a/light/ltface.c b/light/ltface.c index d2cac3f6..b0213c4b 100644 --- a/light/ltface.c +++ b/light/ltface.c @@ -1749,6 +1749,8 @@ static const char * Face_TextureName(const bsp2_t *bsp, const bsp2_dface_t *face) { int texnum = bsp->texinfo[face->texinfo].miptex; + if (!bsp->texdatasize) + return ""; const dmiptexlump_t *miplump = bsp->dtexdata.header; if (!miplump->dataofs[texnum]) return ""; //sometimes the texture just wasn't written. including its name. diff --git a/light/trace.c b/light/trace.c index 2eec8362..439d832d 100644 --- a/light/trace.c +++ b/light/trace.c @@ -148,6 +148,9 @@ Face_Contents(const bsp2_t *bsp, const bsp2_dface_t *face) if (!(bsp->texinfo[face->texinfo].flags & TEX_SPECIAL)) return CONTENTS_SOLID; + if (!bsp->texdatasize) + return CONTENTS_SOLID; // no textures in bsp + int texnum = bsp->texinfo[face->texinfo].miptex; const dmiptexlump_t *miplump = bsp->dtexdata.header; const miptex_t *miptex;