mirror of
https://github.com/mpv-player/mpv
synced 2024-10-30 04:46:41 +01: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:
parent
db0fb3c48b
commit
28b2fa4b7e
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user