Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8f251662 authored by Mathias Agopian's avatar Mathias Agopian Committed by Android (Google) Code Review
Browse files

Merge "check that the NativeWindowType is valid in eglCreateWindowSurface"

parents aca0d07d 10e9ab50
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -836,6 +836,10 @@ int Surface::query(int what, int* value) const {
                *value = mFrameTimestampsSupportsRetire ? 1 : 0;
                return NO_ERROR;
            }
            case NATIVE_WINDOW_IS_VALID: {
                *value = mGraphicBufferProducer != nullptr ? 1 : 0;
                return NO_ERROR;
            }
        }
    }
    return mGraphicBufferProducer->query(what, value);
+10 −0
Original line number Diff line number Diff line
@@ -478,6 +478,16 @@ EGLSurface eglCreateWindowSurface( EGLDisplay dpy, EGLConfig config,
    if (dp) {
        EGLDisplay iDpy = dp->disp.dpy;

        if (!window) {
            return setError(EGL_BAD_NATIVE_WINDOW, EGL_NO_SURFACE);
        }

        int value = 0;
        window->query(window, NATIVE_WINDOW_IS_VALID, &value);
        if (!value) {
            return setError(EGL_BAD_NATIVE_WINDOW, EGL_NO_SURFACE);
        }

        int result = native_window_api_connect(window, NATIVE_WINDOW_API_EGL);
        if (result != OK) {
            ALOGE("eglCreateWindowSurface: native_window_api_connect (win=%p) "