Commit 2aac5ad2 authored by James Almer's avatar James Almer

avcodec/mpeg2_metadata: unref output packet on failure

Move the check and unref call to the end to be consistent with other
bsfs.

Reviewed-by: jkqxz
Signed-off-by: 's avatarJames Almer <jamrial@gmail.com>
parent ae36d6cd
......@@ -188,7 +188,7 @@ static int mpeg2_metadata_filter(AVBSFContext *bsf, AVPacket *out)
err = ff_bsf_get_packet(bsf, &in);
if (err < 0)
goto fail;
return err;
err = ff_cbs_read_packet(ctx->cbc, frag, in);
if (err < 0) {
......@@ -209,15 +209,15 @@ static int mpeg2_metadata_filter(AVBSFContext *bsf, AVPacket *out)
}
err = av_packet_copy_props(out, in);
if (err < 0) {
av_packet_unref(out);
if (err < 0)
goto fail;
}
err = 0;
fail:
ff_cbs_fragment_uninit(ctx->cbc, frag);
if (err < 0)
av_packet_unref(out);
av_packet_free(&in);
return err;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment