glx: If DRI2GetBuffers changes the GL context, call it again
authorMichel Dänzer <michel.daenzer@amd.com>
Mon, 21 Apr 2014 08:47:15 +0000 (17:47 +0900)
committerEric Anholt <eric@anholt.net>
Wed, 23 Apr 2014 17:32:44 +0000 (10:32 -0700)
commita69907288d59792fd783f2f1756cde03d4a06f97
tree596295b4e4d624457207630e313e0a18b5453306
parentf6abfece3e59fa8c2e14a61430133816837855f8
glx: If DRI2GetBuffers changes the GL context, call it again

By changing the context, it may also invalidate the DRI2 buffer
information, so we need to get that again.

Fixes crashes due to use-after-free with LIBGL_ALWAYS_INDIRECT=1
glxgears and piglit.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
glx/glxdri2.c