From: Matt Turner Date: Mon, 16 May 2016 21:49:38 +0000 (-0700) Subject: glsl: Check that layout is non-null before dereferencing. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=6a4ff51f7a28124f27da52fe8d1a04025ddf7a83;p=mesa.git 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 --- diff --git a/src/compiler/glsl/ast_to_hir.cpp b/src/compiler/glsl/ast_to_hir.cpp index 338edc86676..b4c6de2a6a1 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())) {