summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libavcodec/filter_units_bsf.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavcodec/filter_units_bsf.c b/libavcodec/filter_units_bsf.c
index bc2ca288dd..0876693c81 100644
--- a/libavcodec/filter_units_bsf.c
+++ b/libavcodec/filter_units_bsf.c
@@ -153,6 +153,8 @@ static int filter_units_filter(AVBSFContext *bsf, AVPacket *out)
goto fail;
fail:
+ if (err < 0)
+ av_packet_unref(out);
ff_cbs_fragment_reset(ctx->cbc, frag);
av_packet_free(&in);