pvr: Fix NULL pointer indirection in pvr_enable_z_replicate()

Check input_subpass->depth_stencil_attachment is non-NULL before indirecting
it.

Signed-off-by: Sarah Walker <sarah.walker@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19475>
This commit is contained in:
Sarah Walker 2022-11-02 14:24:55 +00:00 committed by Marge Bot
parent b0016bc36a
commit ae268884da

View file

@ -1488,7 +1488,8 @@ pvr_enable_z_replicate(struct pvr_renderpass_context *ctx,
struct pvr_render_subpass *input_subpass = subpass->input_subpass;
/* If the subpass writes to the attachment then enable z replication. */
if (*input_subpass->depth_stencil_attachment == replicate_attach_idx &&
if (input_subpass->depth_stencil_attachment &&
*input_subpass->depth_stencil_attachment == replicate_attach_idx &&
!subpass->z_replicate) {
subpass->z_replicate = true;