From 54b5d289b061262f115115881faf88826f40add1 Mon Sep 17 00:00:00 2001 From: Zoran Vuckovic Date: Fri, 19 May 2017 12:14:51 +0200 Subject: [PATCH] Fix crash in GLSL shader driver --- gfx/drivers_shader/shader_glsl.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/gfx/drivers_shader/shader_glsl.c b/gfx/drivers_shader/shader_glsl.c index c75da1b236..a76359eeb6 100644 --- a/gfx/drivers_shader/shader_glsl.c +++ b/gfx/drivers_shader/shader_glsl.c @@ -1433,10 +1433,10 @@ static bool gl_glsl_set_coords(void *handle_data, void *shader_data, /* Avoid hitting malloc on every single regular quad draw. */ size_t elems = 0; - elems += (uni->color) * 4; - elems += (uni->tex_coord) * 2; - elems += (uni->vertex_coord) * 2; - elems += (uni->lut_tex_coord) * 2; + elems += (uni->color >= 0) * 4; + elems += (uni->tex_coord >= 0) * 2; + elems += (uni->vertex_coord >= 0) * 2; + elems += (uni->lut_tex_coord >= 0) * 2; elems *= coords->vertices * sizeof(GLfloat);