ffmpeg | branch: master | Andreas Rheinhardt <andreas.rheinha...@gmail.com> | 
Mon Jun 17 05:42:08 2019 +0200| [45fd7e44a4ddee636d8c30b92b6a0ff39f976936] | 
committer: Mark Thompson

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.rheinha...@gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=45fd7e44a4ddee636d8c30b92b6a0ff39f976936
---

 libavcodec/filter_units_bsf.c | 2 ++
 1 file changed, 2 insertions(+)

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);
 

_______________________________________________
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".

Reply via email to