summaryrefslogtreecommitdiffstats
path: root/src/egl/main/eglapi.c
diff options
context:
space:
mode:
authorAdam Jackson <[email protected]>2017-11-16 13:27:27 -0500
committerAdam Jackson <[email protected]>2017-11-17 16:43:16 -0500
commitddcd4b05a35fdad400637c3decfa9fe183b3e8c7 (patch)
tree374c93bdfadb918179b126a6908b97af4053034e /src/egl/main/eglapi.c
parent1831e3fb1dc2e8bdc624742fc928e892fc665d26 (diff)
egl: Convert int to attrib in eglGetPlatformDisplay
... because converting attrib to int truncates, and that's bad. Signed-off-by: Adam Jackson <[email protected]> Reviewed-by: Eric Engestrom <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
Diffstat (limited to 'src/egl/main/eglapi.c')
-rw-r--r--src/egl/main/eglapi.c27
1 files changed, 13 insertions, 14 deletions
diff --git a/src/egl/main/eglapi.c b/src/egl/main/eglapi.c
index c1bf5bbfe19..cec67425e13 100644
--- a/src/egl/main/eglapi.c
+++ b/src/egl/main/eglapi.c
@@ -376,7 +376,7 @@ eglGetDisplay(EGLNativeDisplayType nativeDisplay)
static EGLDisplay
_eglGetPlatformDisplayCommon(EGLenum platform, void *native_display,
- const EGLint *attrib_list)
+ const EGLAttrib *attrib_list)
{
_EGLDisplay *dpy;
@@ -412,28 +412,27 @@ _eglGetPlatformDisplayCommon(EGLenum platform, void *native_display,
static EGLDisplay EGLAPIENTRY
eglGetPlatformDisplayEXT(EGLenum platform, void *native_display,
- const EGLint *attrib_list)
+ const EGLint *int_attribs)
{
+ EGLAttrib *attrib_list;
+ EGLDisplay display;
+
_EGL_FUNC_START(NULL, EGL_OBJECT_THREAD_KHR, NULL, EGL_NO_DISPLAY);
- return _eglGetPlatformDisplayCommon(platform, native_display, attrib_list);
+
+ if (_eglConvertIntsToAttribs(int_attribs, &attrib_list) != EGL_SUCCESS)
+ RETURN_EGL_ERROR(NULL, EGL_BAD_ALLOC, NULL);
+
+ display = _eglGetPlatformDisplayCommon(platform, native_display, attrib_list);
+ free(attrib_list);
+ return display;
}
EGLDisplay EGLAPIENTRY
eglGetPlatformDisplay(EGLenum platform, void *native_display,
const EGLAttrib *attrib_list)
{
- EGLDisplay display;
- EGLint *int_attribs;
-
_EGL_FUNC_START(NULL, EGL_OBJECT_THREAD_KHR, NULL, EGL_NO_DISPLAY);
-
- int_attribs = _eglConvertAttribsToInt(attrib_list);
- if (attrib_list && !int_attribs)
- RETURN_EGL_ERROR(NULL, EGL_BAD_ALLOC, NULL);
-
- display = _eglGetPlatformDisplayCommon(platform, native_display, int_attribs);
- free(int_attribs);
- return display;
+ return _eglGetPlatformDisplayCommon(platform, native_display, attrib_list);
}
/**