mesa/fbo: lock ctx->Shared->Mutex when allocating renderbuffers
authorMartin Peres <martin.peres@linux.intel.com>
Mon, 30 Mar 2015 07:34:20 +0000 (10:34 +0300)
committerMartin Peres <martin.peres@linux.intel.com>
Wed, 1 Apr 2015 06:36:27 +0000 (09:36 +0300)
commit59af7ed28cd1b44b525a7d6a324c4e00092104b6
tree7d6a4c5cecffb589bf9bd757e307f2573e460d52
parentfa3832155100850da8346faa64c3cb30c4e86e39
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>
src/mesa/main/fbobject.c