mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-06-21 03:48:22 +02:00
v3d: release the texture reference if shadow resource creation fails
v3d_create_sampler_view() takes a reference on the texture before setting up the view, but the shadow resource error path frees the view without releasing it. Release the reference before bailing so the texture reference count stays balanced. Signed-off-by: JaeHoon Lee <dlwognsdc610@gmail.com> Reviewed-by: Iago Toral Quiroga <itoral@igalia.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/42169>
This commit is contained in:
parent
8d17c7e282
commit
7e8e95f79b
1 changed files with 1 additions and 0 deletions
|
|
@ -1175,6 +1175,7 @@ v3d_create_sampler_view(struct pipe_context *pctx, struct pipe_resource *prsc,
|
|||
*/
|
||||
prsc = v3d_resource_create(pctx->screen, &tmpl);
|
||||
if (!prsc) {
|
||||
pipe_resource_reference(&so->base.texture, NULL);
|
||||
free(so);
|
||||
return NULL;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue