mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-01-20 06:11:04 +00:00
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: James Almer <jamrial@gmail.com>
This commit is contained in:
parent
ae36d6cdde
commit
2aac5ad2f7
@ -188,7 +188,7 @@ static int mpeg2_metadata_filter(AVBSFContext *bsf, AVPacket *out)
|
|||||||
|
|
||||||
err = ff_bsf_get_packet(bsf, &in);
|
err = ff_bsf_get_packet(bsf, &in);
|
||||||
if (err < 0)
|
if (err < 0)
|
||||||
goto fail;
|
return err;
|
||||||
|
|
||||||
err = ff_cbs_read_packet(ctx->cbc, frag, in);
|
err = ff_cbs_read_packet(ctx->cbc, frag, in);
|
||||||
if (err < 0) {
|
if (err < 0) {
|
||||||
@ -209,15 +209,15 @@ static int mpeg2_metadata_filter(AVBSFContext *bsf, AVPacket *out)
|
|||||||
}
|
}
|
||||||
|
|
||||||
err = av_packet_copy_props(out, in);
|
err = av_packet_copy_props(out, in);
|
||||||
if (err < 0) {
|
if (err < 0)
|
||||||
av_packet_unref(out);
|
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
|
||||||
|
|
||||||
err = 0;
|
err = 0;
|
||||||
fail:
|
fail:
|
||||||
ff_cbs_fragment_uninit(ctx->cbc, frag);
|
ff_cbs_fragment_uninit(ctx->cbc, frag);
|
||||||
|
|
||||||
|
if (err < 0)
|
||||||
|
av_packet_unref(out);
|
||||||
av_packet_free(&in);
|
av_packet_free(&in);
|
||||||
|
|
||||||
return err;
|
return err;
|
||||||
|
Loading…
Reference in New Issue
Block a user