[Mesa-dev] [PATCH 4/4] radeonsi: fix crash while binding a NULL constant buffer

Michel Dänzer michel at daenzer.net
Thu Mar 21 23:30:23 PDT 2013


On Don, 2013-03-21 at 20:27 +0100, Marek Olšák wrote: 
> ---
>  src/gallium/drivers/radeonsi/si_state.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/gallium/drivers/radeonsi/si_state.c b/src/gallium/drivers/radeonsi/si_state.c
> index a395ec4..fee1b7f 100644
> --- a/src/gallium/drivers/radeonsi/si_state.c
> +++ b/src/gallium/drivers/radeonsi/si_state.c
> @@ -2491,7 +2491,7 @@ static void si_set_constant_buffer(struct pipe_context *ctx, uint shader, uint i
>  	/* Note that the state tracker can unbind constant buffers by
>  	 * passing NULL here.
>  	 */
> -	if (cb == NULL)
> +	if (cb == NULL || (!cb->buffer && !cb->user_buffer))
>  		return;
>  
>  	pm4 = CALLOC_STRUCT(si_pm4_state);

Reviewed-by: Michel Dänzer <michel.daenzer at amd.com>


-- 
Earthling Michel Dänzer           |                   http://www.amd.com
Libre software enthusiast         |          Debian, X and DRI developer


More information about the mesa-dev mailing list