Commit 179c9324 by Alistair Strachan

Handle NULL 'value' to eglGetSyncAttribKHR()

The EGL spec does not specifically call out how to handle the case where 'value' passed to eglGetSyncAttribKHR is NULL, however many implementations will set the context error to EGL_BAD_PARAMETER and return without crashing. dEQP has a test which specifically checks for this behavior. Align SwiftShader's implementation with other EGL implementations. Bug: b/74572503 Test: dEQP-EQL GetSyncInvalidValueTest Change-Id: Ic893cd7073c12c463ded78042031df1bf85f6ce2 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/28028Reviewed-by: 's avatarNicolas Capens <nicolascapens@google.com> Tested-by: 's avatarAlistair Strachan <astrachan@google.com>
parent 4c9f4a97
...@@ -1417,6 +1417,11 @@ EGLBoolean GetSyncAttrib(EGLDisplay dpy, EGLSyncKHR sync, EGLint attribute, EGLA ...@@ -1417,6 +1417,11 @@ EGLBoolean GetSyncAttrib(EGLDisplay dpy, EGLSyncKHR sync, EGLint attribute, EGLA
return error(EGL_BAD_PARAMETER, EGL_FALSE); return error(EGL_BAD_PARAMETER, EGL_FALSE);
} }
if(!value)
{
return error(EGL_BAD_PARAMETER, EGL_FALSE);
}
switch(attribute) switch(attribute)
{ {
case EGL_SYNC_TYPE_KHR: case EGL_SYNC_TYPE_KHR:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment