From e78e5c8045e4083e43c878de5ad4445962bef9af Mon Sep 17 00:00:00 2001 From: Christoph Haag Date: Fri, 8 Nov 2019 16:07:10 +0100 Subject: [PATCH] st/oxr: Return appropriate errors for incomplete OpenGL XLib binding * xDisplay must be a pointer to a Display value * glxDrawable must be a valid GLXDrawable value * glxContext must be a valid GLXContext value intentionally not checked: * glxFBConfig must be a valid GLXFBConfig value We don't care about this one for now. --- src/xrt/state_trackers/oxr/oxr_verify.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/xrt/state_trackers/oxr/oxr_verify.c b/src/xrt/state_trackers/oxr/oxr_verify.c index 0c84630f8..38e914eb8 100644 --- a/src/xrt/state_trackers/oxr/oxr_verify.c +++ b/src/xrt/state_trackers/oxr/oxr_verify.c @@ -535,9 +535,25 @@ oxr_verify_XrGraphicsBindingOpenGLXlibKHR( { if (next->type != XR_TYPE_GRAPHICS_BINDING_OPENGL_XLIB_KHR) { return oxr_error(log, XR_ERROR_VALIDATION_FAILURE, - " Graphics binding has invalid type"); + "Graphics binding has invalid type"); } + if (next->xDisplay == NULL) { + return oxr_error(log, XR_ERROR_VALIDATION_FAILURE, + "xDisplay is NULL"); + } + + if (next->glxContext == NULL) { + return oxr_error(log, XR_ERROR_VALIDATION_FAILURE, + "glxContext is NULL"); + } + + if (next->glxDrawable == NULL) { + return oxr_error(log, XR_ERROR_VALIDATION_FAILURE, + "glxDrawable is NULL"); + } + + return XR_SUCCESS; }