mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-09 04:38:03 +02:00
glx: Added missing null check in GetDrawableAttribute()
For GLX_BACK_BUFFER_AGE_EXT query added extra null check. Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
This commit is contained in:
parent
0f7958aac2
commit
2670d0f91d
1 changed files with 8 additions and 4 deletions
|
|
@ -319,8 +319,8 @@ GetDrawableAttribute(Display * dpy, GLXDrawable drawable,
|
|||
pdraw = GetGLXDRIDrawable(dpy, drawable);
|
||||
|
||||
if (attribute == GLX_BACK_BUFFER_AGE_EXT) {
|
||||
struct glx_screen *psc = pdraw->psc;
|
||||
struct glx_context *gc = __glXGetCurrentContext();
|
||||
struct glx_screen *psc;
|
||||
|
||||
/* The GLX_EXT_buffer_age spec says:
|
||||
*
|
||||
|
|
@ -328,12 +328,16 @@ GetDrawableAttribute(Display * dpy, GLXDrawable drawable,
|
|||
* the calling thread's current context a GLXBadDrawable error is
|
||||
* generated."
|
||||
*/
|
||||
if (gc == NULL || gc->currentDpy != dpy ||
|
||||
(gc->currentDrawable != drawable && gc->currentReadable != drawable)) {
|
||||
__glXSendError(dpy, GLXBadDrawable, drawable, X_GLXGetDrawableAttributes, false);
|
||||
if (pdraw == NULL || gc == NULL || gc->currentDpy != dpy ||
|
||||
(gc->currentDrawable != drawable &&
|
||||
gc->currentReadable != drawable)) {
|
||||
__glXSendError(dpy, GLXBadDrawable, drawable,
|
||||
X_GLXGetDrawableAttributes, false);
|
||||
return 0;
|
||||
}
|
||||
|
||||
psc = pdraw->psc;
|
||||
|
||||
if (psc->driScreen->getBufferAge != NULL)
|
||||
*value = psc->driScreen->getBufferAge(pdraw);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue