Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix eglMakeCurrent and eglDestroySurface validation checks #4652

Open
wants to merge 1 commit into
base: 24.lts.1+
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions third_party/angle/src/libANGLE/validationEGL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1851,7 +1851,8 @@ Error ValidateMakeCurrent(Display *display, Surface *draw, Surface *read, gl::Co
ANGLE_TRY(ValidateContext(display, context));
}

if (display->isInitialized() && display->isDeviceLost())
if (display->isInitialized() && display->isDeviceLost() &&
(context != EGL_NO_CONTEXT || draw != EGL_NO_SURFACE || read != EGL_NO_SURFACE))
{
return EglContextLost();
}
Expand Down Expand Up @@ -3059,7 +3060,17 @@ Error ValidateDestroySurface(const Display *display,
const Surface *surface,
const EGLSurface eglSurface)
{
ANGLE_TRY(ValidateSurface(display, surface));
ANGLE_TRY(ValidateDisplayPointer(display));

if (!display->isInitialized())
{
return EglNotInitialized() << "display is not initialized.";
}

if (!display->isValidSurface(surface))
{
return EglBadSurface();
}

if (eglSurface == EGL_NO_SURFACE)
{
Expand Down
Loading