1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-19 05:15:12 +00:00

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

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);