Fix the segfault on leaving e1m2.

Problem and solution found by Deek, reason by me.
This commit is contained in:
Bill Currie 2012-01-31 09:51:44 +09:00
parent c3d2365bd8
commit 1052bd2624

View file

@ -65,7 +65,8 @@ glsl_brush_clear (model_t *m)
m->needload = true;
for (i = 0; i < m->numtextures; i++) {
if (m->textures[i]->gl_texturenum) {
// NOTE: some maps (eg e1m2) have empty texture slots
if (m->textures[i] && m->textures[i]->gl_texturenum) {
GL_ReleaseTexture (m->textures[i]->gl_texturenum);
m->textures[i]->gl_texturenum = 0;
}