diff options
author | Nicolai Hähnle <[email protected]> | 2017-02-02 18:06:27 +0100 |
---|---|---|
committer | Nicolai Hähnle <[email protected]> | 2017-02-06 17:39:30 +0100 |
commit | f446f3fb33528eebe9b120340fca3ac5c5ba518d (patch) | |
tree | 9c4c5a1da5da416a7e1e7bc9e0bfad6f0c6cb417 /src/glx/dri3_glx.c | |
parent | 21ec35566be2c1aca07083a67f462618ae15fa86 (diff) |
glx: guard swap-interval functions against destroyed drawables
The GLX specification says about glXDestroyPixmap:
"The storage for the GLX pixmap will be freed when it is not current
to any client."
So arguably, functions like glXSwapIntervalMESA can be called after
glXDestroyPixmap has been called for the currently bound GLXPixmap.
In that case, the GLXDRIDrawable no longer exists, and so we just skip
those calls.
Cc: 17.0 <[email protected]>
Reviewed-by: Marek Olšák <[email protected]>
Reviewed-by: Emil Velikov <[email protected]>
Diffstat (limited to 'src/glx/dri3_glx.c')
-rw-r--r-- | src/glx/dri3_glx.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/glx/dri3_glx.c b/src/glx/dri3_glx.c index 2d40f0ad458..42a94f9f242 100644 --- a/src/glx/dri3_glx.c +++ b/src/glx/dri3_glx.c @@ -564,6 +564,8 @@ dri3_destroy_screen(struct glx_screen *base) static int dri3_set_swap_interval(__GLXDRIdrawable *pdraw, int interval) { + assert(pdraw != NULL); + struct dri3_drawable *priv = (struct dri3_drawable *) pdraw; GLint vblank_mode = DRI_CONF_VBLANK_DEF_INTERVAL_1; struct dri3_screen *psc = (struct dri3_screen *) priv->base.psc; @@ -597,6 +599,8 @@ dri3_set_swap_interval(__GLXDRIdrawable *pdraw, int interval) static int dri3_get_swap_interval(__GLXDRIdrawable *pdraw) { + assert(pdraw != NULL); + struct dri3_drawable *priv = (struct dri3_drawable *) pdraw; return priv->swap_interval; |