summaryrefslogtreecommitdiffstats
path: root/video
diff options
context:
space:
mode:
authorsfan5 <sfan5@live.de>2023-06-03 17:06:36 +0200
committersfan5 <sfan5@live.de>2023-06-03 17:07:43 +0200
commite18cf0b92a25bfef5dd99b195effaf59a34f101b (patch)
treec4100207fb32407cb809d5569525c888330fd218 /video
parentc1bef0f084b339b79f7b6551267bf59fe12f9389 (diff)
downloadmpv-e18cf0b92a25bfef5dd99b195effaf59a34f101b.tar.bz2
mpv-e18cf0b92a25bfef5dd99b195effaf59a34f101b.tar.xz
video/out/android: assert WinID value before use
Diffstat (limited to 'video')
-rw-r--r--video/out/android_common.c1
-rw-r--r--video/out/vo_mediacodec_embed.c1
2 files changed, 2 insertions, 0 deletions
diff --git a/video/out/android_common.c b/video/out/android_common.c
index 7efed3caee..27e7b5bb5b 100644
--- a/video/out/android_common.c
+++ b/video/out/android_common.c
@@ -44,6 +44,7 @@ bool vo_android_init(struct vo *vo)
goto fail;
}
+ assert(vo->opts->WinID != 0 && vo->opts->WinID != -1);
jobject surface = (jobject)(intptr_t)vo->opts->WinID;
ctx->native_window = ANativeWindow_fromSurface(env, surface);
if (!ctx->native_window) {
diff --git a/video/out/vo_mediacodec_embed.c b/video/out/vo_mediacodec_embed.c
index aef7e1a23d..3a1df2fd2c 100644
--- a/video/out/vo_mediacodec_embed.c
+++ b/video/out/vo_mediacodec_embed.c
@@ -37,6 +37,7 @@ static AVBufferRef *create_mediacodec_device_ref(struct vo *vo)
AVHWDeviceContext *ctx = (void *)device_ref->data;
AVMediaCodecDeviceContext *hwctx = ctx->hwctx;
+ assert(vo->opts->WinID != 0 && vo->opts->WinID != -1);
hwctx->surface = (void *)(intptr_t)(vo->opts->WinID);
if (av_hwdevice_ctx_init(device_ref) < 0)