diff options
author | James Almer <jamrial@gmail.com> | 2018-03-20 00:55:28 -0300 |
---|---|---|
committer | James Almer <jamrial@gmail.com> | 2018-03-20 18:26:38 -0300 |
commit | 2aac5ad2f72cf9a1f024187b78f949c5613ceacd (patch) | |
tree | 07e32bfd8f2807e52dbe8432c91568d8792f1ed4 | |
parent | ae36d6cdde0799099dee0397427438bfc86bc1d9 (diff) | |
download | ffmpeg-2aac5ad2f72cf9a1f024187b78f949c5613ceacd.tar.gz |
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>
-rw-r--r-- | libavcodec/mpeg2_metadata_bsf.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/libavcodec/mpeg2_metadata_bsf.c b/libavcodec/mpeg2_metadata_bsf.c index 6d5f581ab1..e787cb3782 100644 --- a/libavcodec/mpeg2_metadata_bsf.c +++ b/libavcodec/mpeg2_metadata_bsf.c @@ -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; |