diff options
author | Niklas Haas <git@haasn.xyz> | 2017-09-18 05:42:54 +0200 |
---|---|---|
committer | Niklas Haas <git@haasn.xyz> | 2017-09-21 15:15:15 +0200 |
commit | 28b2fa4b7e1d58fbe394562d7bc782cb679ad80e (patch) | |
tree | 5590e25f204fd5204e795d010d1b611908bd1015 /video/out/gpu/shader_cache.c | |
parent | db0fb3c48b12f09170231fccd2c91687d9ce21db (diff) | |
download | mpv-28b2fa4b7e1d58fbe394562d7bc782cb679ad80e.tar.bz2 mpv-28b2fa4b7e1d58fbe394562d7bc782cb679ad80e.tar.xz |
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.
Diffstat (limited to 'video/out/gpu/shader_cache.c')
-rw-r--r-- | video/out/gpu/shader_cache.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/video/out/gpu/shader_cache.c b/video/out/gpu/shader_cache.c index afda9cc036..ead759d931 100644 --- a/video/out/gpu/shader_cache.c +++ b/video/out/gpu/shader_cache.c @@ -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); |