From e18cf0b92a25bfef5dd99b195effaf59a34f101b Mon Sep 17 00:00:00 2001 From: sfan5 Date: Sat, 3 Jun 2023 17:06:36 +0200 Subject: video/out/android: assert WinID value before use --- video/out/vo_mediacodec_embed.c | 1 + 1 file changed, 1 insertion(+) (limited to 'video/out/vo_mediacodec_embed.c') 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) -- cgit v1.2.3