From 2fdb7ab6b3d3bcc913af87b1915023f6d7b443e0 Mon Sep 17 00:00:00 2001 From: Spoike Date: Sun, 24 Jan 2021 14:33:45 +0000 Subject: [PATCH] Fix Tulkas' crashes. git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5802 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/gl/gl_vidcommon.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/engine/gl/gl_vidcommon.c b/engine/gl/gl_vidcommon.c index 262607bec..c68d9ca21 100644 --- a/engine/gl/gl_vidcommon.c +++ b/engine/gl/gl_vidcommon.c @@ -2651,7 +2651,7 @@ GLhandleARB GLSlang_CreateProgramObject (program_t *prog, const char *name, GLha { if (gl_config.maxattribs > shader_attr_names[i].ptype) { - if (prog->explicitsyms) + if (prog && prog->explicitsyms) qglBindAttribLocationARB(program, shader_attr_names[i].ptype, va("fte_%s", shader_attr_names[i].name)); else qglBindAttribLocationARB(program, shader_attr_names[i].ptype, shader_attr_names[i].name); @@ -2891,7 +2891,7 @@ static void GLSlang_ProgAutoFields(program_t *prog, struct programpermu_s *pp, c GLSlang_UseProgram(pp->h.glsl.handle); for (i = 0; shader_attr_names[i].name; i++) { - if (prog->explicitsyms) + if (prog && prog->explicitsyms) uniformloc = qglGetAttribLocationARB(pp->h.glsl.handle, va("fte_%s", shader_attr_names[i].name)); else uniformloc = qglGetAttribLocationARB(pp->h.glsl.handle, shader_attr_names[i].name);