summaryrefslogtreecommitdiffstats
path: root/audio/decode/ad_lavc.c
diff options
context:
space:
mode:
authorNRK <nrk@disroot.org>2023-06-22 18:16:38 +0600
committersfan5 <sfan5@live.de>2023-06-22 18:13:11 +0200
commit32147956ca6868640f9a7144501aba1b2325ad5d (patch)
tree150b9eabd13ea86e2dd99312d074b82e9cf36383 /audio/decode/ad_lavc.c
parent0af81b16d80e94a8cb3d70622740f0bd99833b75 (diff)
downloadmpv-32147956ca6868640f9a7144501aba1b2325ad5d.tar.bz2
mpv-32147956ca6868640f9a7144501aba1b2325ad5d.tar.xz
ad_lavc: check for allocation failure
Fixes: https://github.com/mpv-player/mpv/issues/11792
Diffstat (limited to 'audio/decode/ad_lavc.c')
-rw-r--r--audio/decode/ad_lavc.c1
1 files changed, 1 insertions, 0 deletions
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;