From: José Fonseca Date: Fri, 4 Jul 2008 18:21:27 +0000 (+0900) Subject: softpipe: Prevent NULL ptr derreference on takedown. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=152ed98b84acf500f4b5122cf3fde82c6e5206f2;p=mesa.git softpipe: Prevent NULL ptr derreference on takedown. --- diff --git a/src/gallium/drivers/softpipe/sp_state_fs.c b/src/gallium/drivers/softpipe/sp_state_fs.c index 24b91fbc794..901c8f83e75 100644 --- a/src/gallium/drivers/softpipe/sp_state_fs.c +++ b/src/gallium/drivers/softpipe/sp_state_fs.c @@ -154,8 +154,8 @@ softpipe_set_constant_buffer(struct pipe_context *pipe, /* note: reference counting */ pipe_buffer_reference(ws, &softpipe->constants[shader].buffer, - buf->buffer); - softpipe->constants[shader].size = buf->size; + buf ? buf->buffer : NULL); + softpipe->constants[shader].size = buf ? buf->size : 0; softpipe->dirty |= SP_NEW_CONSTANTS; }