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>
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user