From 32147956ca6868640f9a7144501aba1b2325ad5d Mon Sep 17 00:00:00 2001 From: NRK Date: Thu, 22 Jun 2023 18:16:38 +0600 Subject: [PATCH] ad_lavc: check for allocation failure Fixes: https://github.com/mpv-player/mpv/issues/11792 --- audio/decode/ad_lavc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/audio/decode/ad_lavc.c b/audio/decode/ad_lavc.c index 99d04a8f85..08b789a709 100644 --- a/audio/decode/ad_lavc.c +++ b/audio/decode/ad_lavc.c @@ -105,6 +105,7 @@ static bool init(struct mp_filter *da, struct mp_codec_params *codec, ctx->avctx = lavc_context; ctx->avframe = av_frame_alloc(); ctx->avpkt = av_packet_alloc(); + MP_HANDLE_OOM(ctx->avctx && ctx->avframe && ctx->avpkt); lavc_context->codec_type = AVMEDIA_TYPE_AUDIO; lavc_context->codec_id = lavc_codec->id; lavc_context->pkt_timebase = ctx->codec_timebase;