ad_lavc: check for allocation failure

Fixes: https://github.com/mpv-player/mpv/issues/11792
This commit is contained in:
NRK 2023-06-22 18:16:38 +06:00 committed by sfan5
parent 0af81b16d8
commit 32147956ca
1 changed files with 1 additions and 0 deletions

View File

@ -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;