mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 03:08:05 +02:00
mesa/fbo: lock ctx->Shared->Mutex when allocating renderbuffers
This mutex is used to make sure the shared context does not change
while some shared code is looking into it.
Calling BindRenderbufferEXT BindRenderbuffer with a gles context
would not take the mutex before allocating an entry. Commit a34669b
then moved out the allocation out of bind_renderbuffer into
allocate_renderbuffer before using it for the CreateRenderBuffer
entry point. This thus also made this entry point unsafe.
The issue has been hinted by Ilia Mirkin.
Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Martin Peres <martin.peres@linux.intel.com>
This commit is contained in:
parent
fa38321551
commit
59af7ed28c
1 changed files with 2 additions and 0 deletions
|
|
@ -1218,8 +1218,10 @@ allocate_renderbuffer(struct gl_context *ctx, GLuint renderbuffer,
|
|||
return NULL;
|
||||
}
|
||||
assert(newRb->AllocStorage);
|
||||
mtx_lock(&ctx->Shared->Mutex);
|
||||
_mesa_HashInsert(ctx->Shared->RenderBuffers, renderbuffer, newRb);
|
||||
newRb->RefCount = 1; /* referenced by hash table */
|
||||
mtx_unlock(&ctx->Shared->Mutex);
|
||||
|
||||
return newRb;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue