[FFmpeg-cvslog] avcodec/bsf: Unref the packet when flushing

Andreas Rheinhardt git at videolan.org
Tue Sep 14 15:27:10 EEST 2021


ffmpeg | branch: master | Andreas Rheinhardt <andreas.rheinhardt at outlook.com> | Mon Sep  6 22:31:38 2021 +0200| [bbc24363f137377376cea59a48affe7c556b8c30] | committer: Andreas Rheinhardt

avcodec/bsf: Unref the packet when flushing

The documentation does not require the packet to be blank in this case
(i.e. it can now contain opaque_ref), but it does contain that the
contents will be reset upon success.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>

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

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

diff --git a/libavcodec/bsf.c b/libavcodec/bsf.c
index 62fe7ae5e8..8ba021cb47 100644
--- a/libavcodec/bsf.c
+++ b/libavcodec/bsf.c
@@ -201,6 +201,8 @@ int av_bsf_send_packet(AVBSFContext *ctx, AVPacket *pkt)
     int ret;
 
     if (!pkt || IS_EMPTY(pkt)) {
+        if (pkt)
+            av_packet_unref(pkt);
         bsfi->eof = 1;
         return 0;
     }



More information about the ffmpeg-cvslog mailing list