From: Keith Whitwell Date: Tue, 2 Nov 2010 12:05:46 +0000 (+0000) Subject: llvmpipe: guard against NULL task->query pointer X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=debcb434891756573ed2dc102ad1b673a8dce7da;p=mesa.git llvmpipe: guard against NULL task->query pointer This doesn't seem like it should be possible, but some test suites manage to hit this case. Avoid crashing release builds under those circumstances. --- diff --git a/src/gallium/drivers/llvmpipe/lp_rast.c b/src/gallium/drivers/llvmpipe/lp_rast.c index d358a983943..decf3bd4499 100644 --- a/src/gallium/drivers/llvmpipe/lp_rast.c +++ b/src/gallium/drivers/llvmpipe/lp_rast.c @@ -485,8 +485,11 @@ static void lp_rast_end_query(struct lp_rasterizer_task *task, const union lp_rast_cmd_arg arg) { - task->query->count[task->thread_index] += task->vis_counter; - task->query = NULL; + assert(task->query); + if (task->query) { + task->query->count[task->thread_index] += task->vis_counter; + task->query = NULL; + } }