mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-06 15:58:05 +02:00
softpipe: make sure that invalid calls to sosettargets don't crash us
This commit is contained in:
parent
8744c36ea4
commit
38b13459be
1 changed files with 7 additions and 0 deletions
|
|
@ -96,6 +96,13 @@ softpipe_set_stream_output_buffers(struct pipe_context *pipe,
|
|||
void *mapped;
|
||||
struct softpipe_resource *res = softpipe_resource(buffers[i]);
|
||||
|
||||
if (!res) {
|
||||
/* the whole call is invalid, bail out */
|
||||
softpipe->so_target.num_buffers = 0;
|
||||
draw_set_mapped_so_buffers(softpipe->draw, map_buffers, 0);
|
||||
return;
|
||||
}
|
||||
|
||||
softpipe->so_target.buffer[i] = res;
|
||||
softpipe->so_target.offset[i] = offsets[i];
|
||||
softpipe->so_target.so_count[i] = 0;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue