mesa/st: Fix NULL access if no fragment shader is bound

Signed-off-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Signed-off-by: Marek Olšák <marek.olsak@amd.com>
This commit is contained in:
Bas Nieuwenhuizen
2016-03-28 17:01:49 +02:00
committed by Marek Olšák
parent b4c72b792c
commit dd5f0950e4

View File

@@ -65,8 +65,8 @@ void st_upload_constants( struct st_context *st,
shader_type == PIPE_SHADER_COMPUTE);
/* update the ATI constants before rendering */
struct ati_fragment_shader *ati_fs = st->fp->ati_fs;
if (shader_type == PIPE_SHADER_FRAGMENT && ati_fs) {
if (shader_type == PIPE_SHADER_FRAGMENT && st->fp->ati_fs) {
struct ati_fragment_shader *ati_fs = st->fp->ati_fs;
unsigned c;
for (c = 0; c < MAX_NUM_FRAGMENT_CONSTANTS_ATI; c++) {