summaryrefslogtreecommitdiffstats
path: root/src/egl/main/eglsurface.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/egl/main/eglsurface.c')
-rw-r--r--src/egl/main/eglsurface.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/egl/main/eglsurface.c b/src/egl/main/eglsurface.c
index e935c832713..5b3e83ee92c 100644
--- a/src/egl/main/eglsurface.c
+++ b/src/egl/main/eglsurface.c
@@ -409,7 +409,11 @@ _eglQuerySurface(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSurface *surface,
_eglError(EGL_BAD_ATTRIBUTE, "eglQuerySurface");
return EGL_FALSE;
}
- *value = drv->API.QueryBufferAge(drv, dpy, surface);
+ EGLint result = drv->API.QueryBufferAge(drv, dpy, surface);
+ /* error happened */
+ if (result < 0)
+ return EGL_FALSE;
+ *value = result;
break;
default:
_eglError(EGL_BAD_ATTRIBUTE, "eglQuerySurface");