glsl: Check that layout is non-null before dereferencing.
authorMatt Turner <mattst88@gmail.com>
Mon, 16 May 2016 21:49:38 +0000 (14:49 -0700)
committerMatt Turner <mattst88@gmail.com>
Wed, 18 May 2016 18:09:37 +0000 (11:09 -0700)
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>
src/compiler/glsl/ast_to_hir.cpp

index 338edc866767e6a11b73190da4d25178acd919bb..b4c6de2a6a1972f46b8da5cf19b197bfb059df77 100644 (file)
@@ -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())) {