From: Lepton Wu Date: Sat, 24 Jul 2021 04:27:00 +0000 (-0700) Subject: gallium: Reset {d,r}Priv in dri_unbind_context X-Git-Tag: upstream/22.3.5~19830 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7ff30a0499bd872d77b0f377414bbc03463b9f87;p=platform%2Fupstream%2Fmesa.git gallium: Reset {d,r}Priv in dri_unbind_context The code in dri_make_current just checks the value of the pointers to decide to update texture_stamp or not. This is buggy since a new allocated drawable could share the same address with the previous released drawable. Fix the stale pointer issue by always resetting these pointers to NULL in dri_unbind_context. v2: Move the reset codes to the end of the function. Signed-off-by: Lepton Wu Cc: mesa-stable Reviewed-by: Adam Jackson Reviewed-by: Emil Velikov Part-of: --- diff --git a/src/gallium/frontends/dri/dri_context.c b/src/gallium/frontends/dri/dri_context.c index 39eae5f..55bfa22 100644 --- a/src/gallium/frontends/dri/dri_context.c +++ b/src/gallium/frontends/dri/dri_context.c @@ -271,6 +271,8 @@ dri_unbind_context(__DRIcontext * cPriv) stapi->make_current(stapi, NULL, NULL, NULL); } } + ctx->dPriv = NULL; + ctx->rPriv = NULL; return GL_TRUE; }