mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-02 03:38:06 +02:00
vbo/dlist: free copied.buffer if no vertices were copied
Other parts of the code asserts that copied.buffer is NULL if there are
no vertices to copy.
Cc: mesa-stable
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13246>
(cherry picked from commit 9b09655a58)
This commit is contained in:
parent
b99dc621ec
commit
c88f0087e6
2 changed files with 8 additions and 3 deletions
|
|
@ -1696,7 +1696,7 @@
|
|||
"description": "vbo/dlist: free copied.buffer if no vertices were copied",
|
||||
"nominated": true,
|
||||
"nomination_type": 0,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"main_sha": null,
|
||||
"because_sha": null
|
||||
},
|
||||
|
|
|
|||
|
|
@ -168,8 +168,13 @@ copy_vertices(struct gl_context *ctx,
|
|||
assert(save->copied.buffer == NULL);
|
||||
save->copied.buffer = malloc(sizeof(fi_type) * sz * prim->count);
|
||||
|
||||
return vbo_copy_vertices(ctx, prim->mode, prim->start, &prim->count,
|
||||
prim->begin, sz, true, save->copied.buffer, src);
|
||||
unsigned r = vbo_copy_vertices(ctx, prim->mode, prim->start, &prim->count,
|
||||
prim->begin, sz, true, save->copied.buffer, src);
|
||||
if (!r) {
|
||||
free(save->copied.buffer);
|
||||
save->copied.buffer = NULL;
|
||||
}
|
||||
return r;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue