EGLImpl: fix crash when eglDestroySurface is passed EGL_NO_SURFACE

This commit is contained in:
Mis012
2025-06-08 13:43:52 +02:00
parent 364070fa1f
commit 99d1a38918

View File

@@ -114,9 +114,11 @@ JNIEXPORT jboolean JNICALL Java_com_google_android_gles_1jni_EGLImpl_native_1egl
{
struct ANativeWindow *native_window = g_hash_table_lookup(egl_surface_hashtable, _PTR(surface));
bool ret = eglDestroySurface(_PTR(display), _PTR(surface));
EGLBoolean ret = eglDestroySurface(_PTR(display), _PTR(surface));
if (ret) {
/* ANativeWindow_fromSurface starts the refcounter at 1, so this will destroy the native window */
ANativeWindow_release(native_window);
}
return ret;
}