Skip to content

Commit 6a0f933

Browse files
1bsyldeveee
authored andcommitted
Android: check native_window is valid before calling ANativeWindow_setBuffersGeometry
1 parent b4b4129 commit 6a0f933

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/video/android/SDL_androidwindow.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,13 @@ bool Android_nativeSurfaceChanged(SDL_Window *window)
204204
SDL_VideoDevice *_this = SDL_GetVideoDevice();
205205
SDL_WindowData *data = window->internal;
206206

207+
// Make sure native_window is valid
208+
if (!data->native_window) {
209+
if (!Android_nativeSurfaceCreated(window)) {
210+
return false;
211+
}
212+
}
213+
207214
// If the surface has been previously destroyed by onNativeSurfaceDestroyed
208215
// or if it is the first time, recreate it.
209216
if (data->egl_surface == EGL_NO_SURFACE) {

0 commit comments

Comments
 (0)