diff --git a/polymer/eduke32/build/src/polymer.c b/polymer/eduke32/build/src/polymer.c index f3965948f..661a78c84 100644 --- a/polymer/eduke32/build/src/polymer.c +++ b/polymer/eduke32/build/src/polymer.c @@ -2628,7 +2628,7 @@ static void polymer_getbuildmaterial(_prmaterial* material, int16_t tile detailpth = NULL; detailpth = gltexcache(tilenum, DETAILPAL, 0); - if (detailpth && (detailpth->hicr->palnum == DETAILPAL)) + if (detailpth && detailpth->hicr && (detailpth->hicr->palnum == DETAILPAL)) { material->detailmap = detailpth->glpic; @@ -2666,7 +2666,7 @@ static void polymer_getbuildmaterial(_prmaterial* material, int16_t tile glowpth = NULL; glowpth = gltexcache(tilenum, GLOWPAL, 0); - if (glowpth && (glowpth->hicr->palnum == GLOWPAL)) + if (glowpth && glowpth->hicr && (glowpth->hicr->palnum == GLOWPAL)) material->glowmap = glowpth->glpic; } } diff --git a/polymer/eduke32/build/src/polymost.c b/polymer/eduke32/build/src/polymost.c index b8929b131..82acfdf94 100644 --- a/polymer/eduke32/build/src/polymost.c +++ b/polymer/eduke32/build/src/polymost.c @@ -2151,7 +2151,7 @@ void drawpoly(double *dpx, double *dpy, int32_t n, int32_t method) hicfindsubst(globalpicnum, DETAILPAL, 0)) detailpth = gltexcache(globalpicnum, DETAILPAL, method&(~3)); - if (detailpth && (detailpth->hicr->palnum == DETAILPAL)) + if (detailpth && detailpth->hicr && (detailpth->hicr->palnum == DETAILPAL)) { bglActiveTextureARB(++texunits); @@ -2197,7 +2197,7 @@ void drawpoly(double *dpx, double *dpy, int32_t n, int32_t method) hicfindsubst(globalpicnum, GLOWPAL, 0)) glowpth = gltexcache(globalpicnum, GLOWPAL, method&(~3)); - if (glowpth && (glowpth->hicr->palnum == GLOWPAL)) + if (glowpth && glowpth->hicr && (glowpth->hicr->palnum == GLOWPAL)) { bglActiveTextureARB(++texunits);