Commit add96ad2 by Alexis Hetu Committed by Alexis Hétu

Fix glDeleteSync validation

glDeleteSync can only delete an existing FenceSync object. Change-Id: Ieb78894175235cc97c67ff0324d59bb5d7619918 Reviewed-on: https://swiftshader-review.googlesource.com/13829Tested-by: 's avatarAlexis Hétu <sugoi@google.com> Reviewed-by: 's avatarNicolas Capens <nicolascapens@google.com>
parent c1ef1ada
...@@ -3053,10 +3053,20 @@ GL_APICALL void GL_APIENTRY glDeleteSync(GLsync sync) ...@@ -3053,10 +3053,20 @@ GL_APICALL void GL_APIENTRY glDeleteSync(GLsync sync)
{ {
TRACE("(GLsync sync = %p)", sync); TRACE("(GLsync sync = %p)", sync);
if(!sync)
{
return;
}
es2::Context *context = es2::getContext(); es2::Context *context = es2::getContext();
if(context) if(context)
{ {
if(!context->getFenceSync(sync))
{
return error(GL_INVALID_VALUE);
}
context->deleteFenceSync(sync); context->deleteFenceSync(sync);
} }
} }
......
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