diff options
author | Ian Romanick <[email protected]> | 2014-12-01 14:16:24 -0800 |
---|---|---|
committer | Emil Velikov <[email protected]> | 2014-12-21 20:51:54 +0000 |
commit | f19fc096e68db51272be2902c6361db70b596369 (patch) | |
tree | 06713c88a0f86ec7909e7ab8d770bda1761e2504 | |
parent | d81e14d29f514c91d36c4ec05b7466bb2e85b06a (diff) |
linker: Wrap access of producer_var with a NULL check
producer_var could be NULL if consumer_var is not NULL and
consumer_is_fs is false. This will occur when the producer is NULL and
the consumer is the geometry shader for a program that contains only a
geometry shader. This will occur starting with the next patch.
Signed-off-by: Ian Romanick <[email protected]>
Cc: [email protected]
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=82585
Reviewed-by: Jordan Justen <[email protected]>
(cherry picked from commit 5eca78a00a5de442aaf541a1095d5cfa6b4f45de)
Nominated-by: Ian Romanick <[email protected]>
-rw-r--r-- | src/glsl/link_varyings.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/glsl/link_varyings.cpp b/src/glsl/link_varyings.cpp index 54ceae1b9eb..fb5c9092050 100644 --- a/src/glsl/link_varyings.cpp +++ b/src/glsl/link_varyings.cpp @@ -830,9 +830,11 @@ varying_matches::record(ir_variable *producer_var, ir_variable *consumer_var) * regardless of where they appear. We can trivially satisfy that * requirement by changing the interpolation type to flat here. */ - producer_var->data.centroid = false; - producer_var->data.sample = false; - producer_var->data.interpolation = INTERP_QUALIFIER_FLAT; + if (producer_var) { + producer_var->data.centroid = false; + producer_var->data.sample = false; + producer_var->data.interpolation = INTERP_QUALIFIER_FLAT; + } if (consumer_var) { consumer_var->data.centroid = false; |