summaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
authorZack Rusin <[email protected]>2013-04-27 00:52:49 -0400
committerZack Rusin <[email protected]>2013-04-27 01:19:12 -0400
commit3bba7878793b38dbc5075e5f7aa77f8c10a25559 (patch)
treef2ddce58d596c73add018493d11fbe0e91ce5f17 /src/gallium
parent0031cde1e199a82dfe4b754931fb0a5bdf5582f9 (diff)
llvmpipe: stop crashing when one of the so targets is null
Fixes a crash when one of the so targets is null. Signed-off-by: Zack Rusin <[email protected]> Reviewed-by: José Fonseca <[email protected]>
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/drivers/llvmpipe/lp_draw_arrays.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_draw_arrays.c b/src/gallium/drivers/llvmpipe/lp_draw_arrays.c
index e8a5880deef..fc947b110d0 100644
--- a/src/gallium/drivers/llvmpipe/lp_draw_arrays.c
+++ b/src/gallium/drivers/llvmpipe/lp_draw_arrays.c
@@ -89,8 +89,11 @@ llvmpipe_draw_vbo(struct pipe_context *pipe, const struct pipe_draw_info *info)
}
for (i = 0; i < lp->num_so_targets; i++) {
- void *buf = llvmpipe_resource(lp->so_targets[i]->target.buffer)->data;
- lp->so_targets[i]->mapping = buf;
+ void *buf = 0;
+ if (lp->so_targets[i]) {
+ buf = llvmpipe_resource(lp->so_targets[i]->target.buffer)->data;
+ lp->so_targets[i]->mapping = buf;
+ }
}
draw_set_mapped_so_targets(draw, lp->num_so_targets,
lp->so_targets);