diff mbox series

[FFmpeg-devel,6/6] avcodec/bsf: Unref the packet when flushing

Message ID AM7PR03MB6660FD0A117E8E403CB34D1A8FD29@AM7PR03MB6660.eurprd03.prod.outlook.com
State Accepted
Commit bbc24363f137377376cea59a48affe7c556b8c30
Headers show
Series [FFmpeg-devel,1/5] configure: Remove null_bsf dependency | expand

Checks

Context Check Description
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished
andriy/make_ppc success Make finished
andriy/make_fate_ppc success Make fate finished

Commit Message

Andreas Rheinhardt Sept. 6, 2021, 8:35 p.m. UTC
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@outlook.com>
---
 libavcodec/bsf.c | 2 ++
 1 file changed, 2 insertions(+)
diff mbox series

Patch

diff --git a/libavcodec/bsf.c b/libavcodec/bsf.c
index 3420885e5f..212f398210 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;
     }