radv/pipeline: Don't dereference NULL dynamic state pointers
authorDarren Salt <devspam@moreofthesa.me.uk>
Sun, 16 Oct 2016 19:32:19 +0000 (20:32 +0100)
committerBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Sat, 12 Nov 2016 14:06:27 +0000 (15:06 +0100)
commit9b121512ac0f78d0996613664b456005d88370d2
treeb97bac88795b9a592136b7dba66e61a4d0fef40a
parentdfc001dccc7a29b1acf8d1ecf8072223aa98bc1b
radv/pipeline: Don't dereference NULL dynamic state pointers

This is a port of commit a4a59172482d50318a5ae7f99021bcf0125e0f53:

   Add guards to prevent dereferencing NULL dynamic pipeline state. Asserts
   of pCreateInfo members are moved to the earliest points at which they
   should not be NULL.

This fixes a segfault, related to pColorBlendState, seen in Talos Principle
which I've observed after startup is completed and when exiting the menus,
depending on when Vulkan rendering is selected.

v2: moved the NULL check in radv_pipeline_init_blend_state to after the
declarations.
Acked-by: Edward O'Callaghan <funfunctor@folklore1984.net>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
src/amd/vulkan/radv_pipeline.c