anv/cmd_buffer: Don't crash if push constants are provided for missing stages
authorJason Ekstrand <jason.ekstrand@intel.com>
Wed, 15 Jun 2016 21:30:33 +0000 (14:30 -0700)
committerJason Ekstrand <jason.ekstrand@intel.com>
Mon, 20 Jun 2016 19:03:02 +0000 (12:03 -0700)
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: "12.0" <mesa-stable@lists.freedesktop.org>
src/intel/vulkan/anv_cmd_buffer.c

index 5be5f3e5ee3f856079bbb3287603b594938bd762..24c18fec4ec1fc8f654bab55d5e2f3fe2d49d59b 100644 (file)
@@ -1038,7 +1038,7 @@ anv_cmd_buffer_push_constants(struct anv_cmd_buffer *cmd_buffer,
       cmd_buffer->state.pipeline->prog_data[stage];
 
    /* If we don't actually have any push constants, bail. */
-   if (data == NULL || prog_data->nr_params == 0)
+   if (data == NULL || prog_data == NULL || prog_data->nr_params == 0)
       return (struct anv_state) { .offset = 0 };
 
    struct anv_state state =