summaryrefslogtreecommitdiffstats
path: root/src/compiler/glsl/ast_to_hir.cpp
diff options
context:
space:
mode:
authorMatt Turner <mattst88@gmail.com>2016-05-16 14:49:38 -0700
committerMatt Turner <mattst88@gmail.com>2016-05-18 11:09:37 -0700
commit6a4ff51f7a28124f27da52fe8d1a04025ddf7a83 (patch)
tree5e890a20128723f496b273bc82416a16a31d41e1 /src/compiler/glsl/ast_to_hir.cpp
parent53f64a84047b3f2766e490311c925a36afc64807 (diff)
downloadexternal_mesa3d-6a4ff51f7a28124f27da52fe8d1a04025ddf7a83.zip
external_mesa3d-6a4ff51f7a28124f27da52fe8d1a04025ddf7a83.tar.gz
external_mesa3d-6a4ff51f7a28124f27da52fe8d1a04025ddf7a83.tar.bz2
glsl: Check that layout is non-null before dereferencing.
layout should only be null for structs, but it's checked everywhere else and confuses Coverity (CID 1358495). Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com>
Diffstat (limited to 'src/compiler/glsl/ast_to_hir.cpp')
-rw-r--r--src/compiler/glsl/ast_to_hir.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/compiler/glsl/ast_to_hir.cpp b/src/compiler/glsl/ast_to_hir.cpp
index 338edc8..b4c6de2 100644
--- a/src/compiler/glsl/ast_to_hir.cpp
+++ b/src/compiler/glsl/ast_to_hir.cpp
@@ -6818,7 +6818,7 @@ ast_process_struct_or_iface_block_members(exec_list *instructions,
* the structure may contain a structure that contains ... a matrix
* that need the proper layout.
*/
- if (is_interface &&
+ if (is_interface && layout &&
(layout->flags.q.uniform || layout->flags.q.buffer) &&
(field_type->without_array()->is_matrix()
|| field_type->without_array()->is_record())) {