mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-25 13:00:09 +01:00
aux/primconvert: handle singular incomplete restarts
if no restart indices are found, this draw must be discarded to avoid
crashing later on
Fixes: 583070748c ("util/primconvert: handle rewriting of prim-restart draws with unsupported primtype")
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13630>
This commit is contained in:
parent
1e869e3fb4
commit
bc345281ab
1 changed files with 5 additions and 2 deletions
|
|
@ -202,8 +202,11 @@ util_primconvert_draw_vbo(struct primconvert_context *pc,
|
|||
&direct_draw_func);
|
||||
/* this should always be a direct translation */
|
||||
assert(new_draw.count == total_index_count);
|
||||
/* step 3: allocate a temp buffer for an intermediate rewrite step */
|
||||
rewrite_buffer = malloc(index_size * total_index_count);
|
||||
/* step 3: allocate a temp buffer for an intermediate rewrite step
|
||||
* if no indices were found, this was a single incomplete restart and can be discarded
|
||||
*/
|
||||
if (total_index_count)
|
||||
rewrite_buffer = malloc(index_size * total_index_count);
|
||||
if (!rewrite_buffer) {
|
||||
if (src_transfer)
|
||||
pipe_buffer_unmap(pc->pipe, src_transfer);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue