[vlc-commits] android: window: check jobj before creating window

Alexandre Janniaux git at videolan.org
Mon Jan 25 11:37:30 UTC 2021


vlc | branch: master | Alexandre Janniaux <ajanni at videolabs.io> | Fri Jan 22 10:28:35 2021 +0100| [faf48ec1ffbc01076d7c91aa963ff0eed5003030] | committer: Alexandre Janniaux

android: window: check jobj before creating window

To avoid creating a AWindowHandler without window.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=faf48ec1ffbc01076d7c91aa963ff0eed5003030
---

 modules/video_output/android/window.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/modules/video_output/android/window.c b/modules/video_output/android/window.c
index 0b8d0337ed..0f601e4af2 100644
--- a/modules/video_output/android/window.c
+++ b/modules/video_output/android/window.c
@@ -90,6 +90,11 @@ static const struct vout_window_operations ops = {
  */
 static int Open(vout_window_t *wnd)
 {
+    /* We cannot create a window without the associated AWindow instance. */
+    jobject jobj = var_InheritAddress(wnd, "drawable-androidwindow");
+    if (jobj == NULL)
+        return VLC_EGENERIC;
+
     AWindowHandler *p_awh = AWindowHandler_new(VLC_OBJECT(wnd), wnd,
         &(awh_events_t) { OnNewWindowSize, OnNewMouseCoords });
     if (p_awh == NULL)



More information about the vlc-commits mailing list