From 9e2d54a9afb1bdeb38c5e6a525a46c0ef9d9732b Mon Sep 17 00:00:00 2001 From: Eric Wasylishen Date: Sun, 10 Apr 2016 15:39:49 -0700 Subject: [PATCH] light: handle bsp's with no textures --- light/ltface.c | 2 ++ light/trace.c | 3 +++ 2 files changed, 5 insertions(+) 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;