mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-25 08:40:11 +01:00
egl: Add eglQuerySurface surface type check for EGL_LARGEST_PBUFFER attrib
Calling eglQuerySurface on a window or pixmap with the EGL_LARGEST_PBUFFER
attribute resulted in the contents of the 'value' parameter being modified.
This is the wrong behaviour according to the EGL spec, which states:
"Querying EGL_LARGEST_PBUFFER for a pbuffer surface returns the
same attribute value specified when the surface was created with
eglCreatePbufferSurface. For a window or pixmap surface, the
contents of value are not modified."
Avoid this from happening by checking that the surface type is EGL_PBUFFER_BIT
before modifying the contents of the parameter.
Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Frank Binns <frank.binns@imgtec.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
This commit is contained in:
parent
cfc3200a35
commit
b2c5986ea1
1 changed files with 2 additions and 1 deletions
|
|
@ -326,7 +326,8 @@ _eglQuerySurface(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSurface *surface,
|
|||
*value = surface->Config->ConfigID;
|
||||
break;
|
||||
case EGL_LARGEST_PBUFFER:
|
||||
*value = surface->LargestPbuffer;
|
||||
if (surface->Type == EGL_PBUFFER_BIT)
|
||||
*value = surface->LargestPbuffer;
|
||||
break;
|
||||
case EGL_TEXTURE_FORMAT:
|
||||
/* texture attributes: only for pbuffers, no error otherwise */
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue