# HG changeset patch # User Mike Becker # Date 1753462491 -7200 # Node ID f72b80448413b69329273a0402ac29470941e58b # Parent 4f32c77551382c1eae11cd4545ca61d8039b5e36 fix broken nullptr handling in asc_shader_use() - fixes #696 diff -r 4f32c7755138 -r f72b80448413 src/shader.c --- a/src/shader.c Fri Jul 25 18:50:36 2025 +0200 +++ b/src/shader.c Fri Jul 25 18:54:51 2025 +0200 @@ -225,10 +225,12 @@ if (asc_shader_invalid(shader)) { asc_active_glctx->active_program = 0; glUseProgram(0); + return -1; + } + if (asc_active_glctx->active_program == shader->gl_id) { + // already using this shader - continue return 0; } - if (asc_active_glctx->active_program == shader->gl_id) return 0; - if (asc_shader_invalid(shader)) return -1; asc_active_glctx->active_program = shader->gl_id; glUseProgram(shader->gl_id); glUniformMatrix4fv(shader->projection, 1, GL_FALSE, camera->projection);