diff options
author | sfan5 <sfan5@live.de> | 2023-06-03 17:06:36 +0200 |
---|---|---|
committer | sfan5 <sfan5@live.de> | 2023-06-03 17:07:43 +0200 |
commit | e18cf0b92a25bfef5dd99b195effaf59a34f101b (patch) | |
tree | c4100207fb32407cb809d5569525c888330fd218 /video | |
parent | c1bef0f084b339b79f7b6551267bf59fe12f9389 (diff) | |
download | mpv-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.c | 1 | ||||
-rw-r--r-- | video/out/vo_mediacodec_embed.c | 1 |
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) |