mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-25 19:30:11 +01:00
softpipe: check if so_target is NULL before accessing it
No idea if this is working right but copied straight from llvmpipe. (Not only does this check the so_target but also use buffer->data instead of buffer for the mapping.) Just trying to get rid of a segfault testing something else... Reviewed-by: Jose Fonseca <jfonseca@vmware.com> Reviewed-by: Zack Rusin <zackr@vmware.com>
This commit is contained in:
parent
289faa7e23
commit
81ab3e57bc
1 changed files with 5 additions and 2 deletions
|
|
@ -107,8 +107,11 @@ softpipe_draw_vbo(struct pipe_context *pipe,
|
|||
|
||||
|
||||
for (i = 0; i < sp->num_so_targets; i++) {
|
||||
void *buf = softpipe_resource_data(sp->so_targets[i]->target.buffer);
|
||||
sp->so_targets[i]->mapping = buf;
|
||||
void *buf = 0;
|
||||
if (sp->so_targets[i]) {
|
||||
buf = softpipe_resource(sp->so_targets[i]->target.buffer)->data;
|
||||
sp->so_targets[i]->mapping = buf;
|
||||
}
|
||||
}
|
||||
|
||||
draw_set_mapped_so_targets(draw, sp->num_so_targets,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue