vo_gpu: fix possible segfault in shader_cache.c

If shader compilation fails in an unexpected way, it can end up calling
renderpass_run on an invalid pass, since current_shader is never cleared.
This commit is contained in:
Niklas Haas 2017-09-18 05:42:54 +02:00
parent db0fb3c48b
commit 28b2fa4b7e
1 changed files with 3 additions and 1 deletions

View File

@ -871,8 +871,10 @@ static void gl_sc_generate(struct gl_shader_cache *sc,
sc->error_state = true;
MP_TARRAY_APPEND(sc, sc->entries, sc->num_entries, entry);
}
if (sc->error_state)
if (sc->error_state) {
sc->current_shader = NULL;
return;
}
assert(sc->num_uniforms == entry->num_cached_uniforms);