mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 22:08:26 +02:00
st/mesa: add null pointer check in st_renderbuffer_delete()
In my testing I haven't found any cases where we get a null context
pointer, but it might still be possible. Check for null just to be safe.
Note: This is a candidate for the stable branches.
(cherry picked from commit a4311054c7)
This commit is contained in:
parent
d4fc90c129
commit
d32aff91c1
1 changed files with 4 additions and 4 deletions
|
|
@ -228,10 +228,10 @@ static void
|
|||
st_renderbuffer_delete(struct gl_context *ctx, struct gl_renderbuffer *rb)
|
||||
{
|
||||
struct st_renderbuffer *strb = st_renderbuffer(rb);
|
||||
struct st_context *st = st_context(ctx);
|
||||
struct pipe_context *pipe = st->pipe;
|
||||
|
||||
pipe_surface_release(pipe, &strb->surface);
|
||||
if (ctx) {
|
||||
struct st_context *st = st_context(ctx);
|
||||
pipe_surface_release(st->pipe, &strb->surface);
|
||||
}
|
||||
pipe_resource_reference(&strb->texture, NULL);
|
||||
free(strb->data);
|
||||
_mesa_delete_renderbuffer(ctx, rb);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue