From bfa3e9086719b594bb738a542ef2bc7956afaf37 Mon Sep 17 00:00:00 2001 From: sfan5 Date: Tue, 11 Feb 2025 18:59:45 +0100 Subject: [PATCH] video/out/android: don't assert-fail if WinID is not set This matches the behavior of every other GPU context and is the only behavior that makes sense. --- video/out/android_common.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/video/out/android_common.c b/video/out/android_common.c index 27e7b5bb5b..6b9ef67db1 100644 --- a/video/out/android_common.c +++ b/video/out/android_common.c @@ -44,7 +44,10 @@ bool vo_android_init(struct vo *vo) goto fail; } - assert(vo->opts->WinID != 0 && vo->opts->WinID != -1); + if (vo->opts->WinID == 0 || vo->opts->WinID == -1) { + MP_FATAL(ctx, "Missing surface pointer\n"); + goto fail; + } jobject surface = (jobject)(intptr_t)vo->opts->WinID; ctx->native_window = ANativeWindow_fromSurface(env, surface); if (!ctx->native_window) {