From 0fe4a492c431610dc69b66eb4397707bda178b99 Mon Sep 17 00:00:00 2001 From: Niklas Haas Date: Mon, 11 Sep 2017 01:02:56 +0200 Subject: vo_opengl: fix out-of-bounds read in update_uniform Since the addition of UBOs, the assumption that the uniform index corresponds to the pass->params.inputs index is no longer true. Also, there's no reason it would even need this - since the `input` is also available directly in sc_uniform. I have no idea how I've been using this code for as long as I have without any segfaults until earlier today. --- video/out/opengl/shader_cache.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'video') diff --git a/video/out/opengl/shader_cache.c b/video/out/opengl/shader_cache.c index 0a722b8492..e702d7e4a1 100644 --- a/video/out/opengl/shader_cache.c +++ b/video/out/opengl/shader_cache.c @@ -491,8 +491,7 @@ static void update_uniform(struct gl_shader_cache *sc, struct sc_entry *e, struct sc_uniform *u, int n) { struct sc_cached_uniform *un = &e->cached_uniforms[n]; - struct ra_renderpass_input *input = &e->pass->params.inputs[n]; - size_t size = ra_render_pass_input_data_size(input); + size_t size = ra_render_pass_input_data_size(&u->input); bool changed = true; if (size > 0) changed = memcmp(&un->v, &u->v, size) != 0; -- cgit v1.2.3