diff mbox series

[FFmpeg-devel,28/34] avformat/tee: Unref packet on av_bsf_send_packet() failure

Message ID AM7PR03MB66605BDDC26970BB0E5254418FD29@AM7PR03MB6660.eurprd03.prod.outlook.com
State New
Headers show
Series [FFmpeg-devel,01/11] avformat/mux: Sanitize packets without data and side-data
Related show


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, 2:27 a.m. UTC
Given that the packet sent to av_bsf_send_packet() is always
already refcounted, it is doubtful whether the error can even
be triggered currently.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
 libavformat/tee.c | 1 +
 1 file changed, 1 insertion(+)
diff mbox series


diff --git a/libavformat/tee.c b/libavformat/tee.c
index a5bf34d083..505873ce1e 100644
--- a/libavformat/tee.c
+++ b/libavformat/tee.c
@@ -575,6 +575,7 @@  static int tee_write_packet(AVFormatContext *avf, AVPacket *pkt)
         ret = av_bsf_send_packet(bsfs, &pkt2);
         if (ret < 0) {
+            av_packet_unref(&pkt2);
             av_log(avf, AV_LOG_ERROR, "Error while sending packet to bitstream filter: %s\n",
             ret = tee_process_slave_failure(avf, i, ret);