summaryrefslogtreecommitdiff
path: root/libavcodec/filter_units_bsf.c
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2019-06-17 05:42:08 +0200
committerMark Thompson <sw@jkqxz.net>2019-07-07 22:17:07 +0100
commit45fd7e44a4ddee636d8c30b92b6a0ff39f976936 (patch)
treec71a5703ae3abeaecc17537e8ac5f33997f456af /libavcodec/filter_units_bsf.c
parent7549f0ac1baffabfa964962c0c0067e8da692982 (diff)
filter_units: Unref packet on failure
According to the API, the packet structure a bsf receives must not be touched on failure, yet filter_units nevertheless did it. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Diffstat (limited to 'libavcodec/filter_units_bsf.c')
-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);