diff options
author | Chia-I Wu <[email protected]> | 2011-12-20 17:25:22 +0800 |
---|---|---|
committer | Chia-I Wu <[email protected]> | 2011-12-20 17:26:18 +0800 |
commit | eb7d1b9474b021769e2d1f1b64901c64130e53d8 (patch) | |
tree | 372eef938941572e34b35c1911b1c82379a8a611 /src/egl | |
parent | 75772842133d101223ca31400e100b83476f327b (diff) |
egl_dri2/x11: error check coordinates in eglPostSubBufferNV
EGL_BAD_PARAMETER should be returned when any of the coordinates is negative.
Diffstat (limited to 'src/egl')
-rw-r--r-- | src/egl/drivers/dri2/platform_x11.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/egl/drivers/dri2/platform_x11.c b/src/egl/drivers/dri2/platform_x11.c index 08a2c8d8789..d789ec6793a 100644 --- a/src/egl/drivers/dri2/platform_x11.c +++ b/src/egl/drivers/dri2/platform_x11.c @@ -248,11 +248,8 @@ dri2_create_surface(_EGLDriver *drv, _EGLDisplay *disp, EGLint type, free(reply); } - if (dri2_dpy->dri2 && type == EGL_WINDOW_BIT && - dri2_surf->base.RenderBuffer == EGL_BACK_BUFFER) - dri2_surf->base.PostSubBufferSupportedNV = EGL_TRUE; - else - dri2_surf->base.PostSubBufferSupportedNV = EGL_FALSE; + /* we always copy the back buffer to front */ + dri2_surf->base.PostSubBufferSupportedNV = EGL_TRUE; return &dri2_surf->base; @@ -760,6 +757,9 @@ dri2_post_sub_buffer(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *draw, { const EGLint rect[4] = { x, draw->Height - y - height, width, height }; + if (x < 0 || y < 0 || width < 0 || height < 0) + _eglError(EGL_BAD_PARAMETER, "eglPostSubBufferNV"); + return dri2_swap_buffers_region(drv, disp, draw, 1, rect); } |