mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-04-21 07:40:38 +02:00
mesa: Fix use after free.
Reset the pointer to the earlier free st_context. Check the st_context pointer before st_glFlush. Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8195 Signed-off-by: Mykola Piatykop <mykola.piatykop@globallogic.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21656>
This commit is contained in:
parent
cb588d5d6e
commit
25fcf0adc3
2 changed files with 4 additions and 1 deletions
|
|
@ -1502,7 +1502,9 @@ _mesa_make_current( struct gl_context *newCtx,
|
|||
curCtx->Const.ContextReleaseBehavior ==
|
||||
GL_CONTEXT_RELEASE_BEHAVIOR_FLUSH) {
|
||||
FLUSH_VERTICES(curCtx, 0, 0);
|
||||
st_glFlush(curCtx, 0);
|
||||
if (curCtx->st){
|
||||
st_glFlush(curCtx, 0);
|
||||
}
|
||||
}
|
||||
|
||||
if (!newCtx) {
|
||||
|
|
|
|||
|
|
@ -371,6 +371,7 @@ st_destroy_context_priv(struct st_context *st, bool destroy_pipe)
|
|||
if (st->pipe && destroy_pipe)
|
||||
st->pipe->destroy(st->pipe);
|
||||
|
||||
st->ctx->st = NULL;
|
||||
FREE(st);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue