You've already forked android_translation_layer
mirror of
https://gitlab.com/android_translation_layer/android_translation_layer.git
synced 2025-10-27 11:48:10 -07:00
src/libandroid/native_window.c: check for NULL in bionic_eglCreateWindowSurface
This commit is contained in:
@@ -222,7 +222,6 @@ static void on_resize(GtkWidget* self, gint width, gint height, struct wl_egl_wi
|
||||
|
||||
ANativeWindow * ANativeWindow_fromSurface(JNIEnv* env, jobject surface)
|
||||
{
|
||||
|
||||
int width;
|
||||
int height;
|
||||
|
||||
@@ -375,6 +374,10 @@ EGLDisplay bionic_eglGetDisplay(NativeDisplayType native_display)
|
||||
|
||||
EGLSurface bionic_eglCreateWindowSurface(EGLDisplay display, EGLConfig config, struct ANativeWindow *native_window, EGLint const *attrib_list)
|
||||
{
|
||||
// better than crashing (TODO: check if apps try to use the NULL value anyway)
|
||||
if(!native_window)
|
||||
return NULL;
|
||||
|
||||
PrintConfigAttributes(display, config);
|
||||
EGLSurface ret = eglCreateWindowSurface(display, config, native_window->egl_window, attrib_list);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user