[Mesa-dev] [PATCH] radv: fix a potential crash if attachments allocation failed

Bas Nieuwenhuizen bas at basnieuwenhuizen.nl
Thu Sep 14 19:42:38 UTC 2017


Reviewed-by: Bas Nieuwenhuizen <bas at basnieuwenhuizen.nl>

On Thu, Sep 14, 2017 at 6:47 PM, Samuel Pitoiset
<samuel.pitoiset at gmail.com> wrote:
> Also, it's useless to set the error code twice. Though, we
> should probably skip the next commands when the command buffer
> is considered invalid.
>
> Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
> ---
>  src/amd/vulkan/radv_cmd_buffer.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/src/amd/vulkan/radv_cmd_buffer.c b/src/amd/vulkan/radv_cmd_buffer.c
> index af9f8210bf..0b56087a09 100644
> --- a/src/amd/vulkan/radv_cmd_buffer.c
> +++ b/src/amd/vulkan/radv_cmd_buffer.c
> @@ -2713,9 +2713,10 @@ void radv_CmdBeginRenderPass(
>         cmd_buffer->state.framebuffer = framebuffer;
>         cmd_buffer->state.pass = pass;
>         cmd_buffer->state.render_area = pRenderPassBegin->renderArea;
> +
>         result = radv_cmd_state_setup_attachments(cmd_buffer, pass, pRenderPassBegin);
>         if (result != VK_SUCCESS)
> -               cmd_buffer->record_result = result;
> +               return;
>
>         radv_cmd_buffer_set_subpass(cmd_buffer, pass->subpasses, true);
>         assert(cmd_buffer->cs->cdw <= cdw_max);
> --
> 2.14.1
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list