avcodec/evc_frame_merge_bsf: free EVCFMergeContext on flush and close

Signed-off-by: James Almer <jamrial@gmail.com>
This commit is contained in:
James Almer 2023-06-15 11:14:07 -03:00
parent b1d0b59d81
commit f24064e627
1 changed files with 3 additions and 1 deletions

View File

@ -60,6 +60,7 @@ static void evc_frame_merge_flush(AVBSFContext *bsf)
{
EVCFMergeContext *ctx = bsf->priv_data;
ff_evc_parse_free(&ctx->parser_ctx);
av_packet_unref(ctx->in);
ctx->au_buffer.data_size = 0;
}
@ -129,7 +130,7 @@ static int evc_frame_merge_filter(AVBSFContext *bsf, AVPacket *out)
err = AVERROR(EAGAIN);
if (err < 0 && err != AVERROR(EAGAIN))
evc_frame_merge_flush(bsf);
ctx->au_buffer.data_size = 0;
return err;
}
@ -154,6 +155,7 @@ static void evc_frame_merge_close(AVBSFContext *bsf)
EVCFMergeContext *ctx = bsf->priv_data;
av_packet_free(&ctx->in);
ff_evc_parse_free(&ctx->parser_ctx);
ctx->au_buffer.capacity = 0;
av_freep(&ctx->au_buffer.data);