[Mesa-dev] [PATCH 14/16] main: Added entry point for glCreateRenderbuffers

Vinson Lee vlee at freedesktop.org
Thu Mar 26 22:06:08 PDT 2015


On Mon, Feb 16, 2015 at 6:14 AM, Martin Peres
<martin.peres at linux.intel.com> wrote:
> @@ -1404,14 +1405,36 @@ _mesa_GenRenderbuffers(GLsizei n, GLuint *renderbuffers)
>     for (i = 0; i < n; i++) {
>        GLuint name = first + i;
>        renderbuffers[i] = name;
> -      /* insert dummy placeholder into hash table */
> +
> +      if (dsa) {
> +         obj = _mesa_new_renderbuffer(ctx, name);
> +      } else {
> +         obj = &DummyRenderbuffer;
> +      }
> +      /* insert the object into the hash table */
>        mtx_lock(&ctx->Shared->Mutex);
> -      _mesa_HashInsert(ctx->Shared->RenderBuffers, name, &DummyRenderbuffer);
> +      _mesa_HashInsert(ctx->Shared->RenderBuffers, name, obj);
>        mtx_unlock(&ctx->Shared->Mutex);
>     }
>  }
>

This patch introduced a new Coverity unused value defect.

returned_pointer: Assigning value from allocate_renderbuffer(ctx,
name, func) to obj here, but that stored value is overwritten before
it can be used.


More information about the mesa-dev mailing list