softpipe: Prevent NULL ptr derreference on takedown.

This commit is contained in:
José Fonseca
2008-07-05 03:21:27 +09:00
parent c23b64f164
commit 152ed98b84
+2 -2
View File
@@ -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;
}