summaryrefslogtreecommitdiffstats
path: root/video
diff options
context:
space:
mode:
authorNiklas Haas <git@haasn.xyz>2017-09-18 05:42:54 +0200
committerNiklas Haas <git@haasn.xyz>2017-09-21 15:15:15 +0200
commit28b2fa4b7e1d58fbe394562d7bc782cb679ad80e (patch)
tree5590e25f204fd5204e795d010d1b611908bd1015 /video
parentdb0fb3c48b12f09170231fccd2c91687d9ce21db (diff)
downloadmpv-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')
-rw-r--r--video/out/gpu/shader_cache.c4
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);