summaryrefslogtreecommitdiffstats
path: root/src/mesa/state_tracker
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2017-01-05 13:47:15 +0100
committerMarek Olšák <[email protected]>2017-01-05 17:11:03 +0100
commit3477f67057f11b3608366f7096f4c6f1c57db509 (patch)
tree58dda5db8a71eb949ef8b17825f23bc9f2a4941e /src/mesa/state_tracker
parent37f926206402e227391179cc1a3fa78b1c2673f7 (diff)
st/mesa: fix a segfault when prog->sh.data is NULL
Broken by: st/mesa: get Version from gl_program rather than gl_shader_program Reviewed-by: Samuel Pitoiset <[email protected]>
Diffstat (limited to 'src/mesa/state_tracker')
-rw-r--r--src/mesa/state_tracker/st_atom_texture.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/mesa/state_tracker/st_atom_texture.c b/src/mesa/state_tracker/st_atom_texture.c
index 58e753dab64..76e512f52aa 100644
--- a/src/mesa/state_tracker/st_atom_texture.c
+++ b/src/mesa/state_tracker/st_atom_texture.c
@@ -123,11 +123,13 @@ update_textures(struct st_context *st,
struct pipe_sampler_view *sampler_view = NULL;
if (samplers_used & 1) {
+ /* prog->sh.data is NULL if it's ARB_fragment_program */
+ unsigned glsl_version = prog->sh.data ? prog->sh.data->Version : 0;
const GLuint texUnit = prog->SamplerUnits[unit];
GLboolean retval;
retval = update_single_texture(st, &sampler_view, texUnit,
- prog->sh.data->Version);
+ glsl_version);
if (retval == GL_FALSE)
continue;