forked from pool/ffmpeg-4
27 lines
891 B
Diff
27 lines
891 B
Diff
|
From c08d300481b8ebb846cd43a473988fdbc6793d1b Mon Sep 17 00:00:00 2001
|
||
|
From: James Almer <jamrial@gmail.com>
|
||
|
Date: Fri, 17 Jan 2025 00:05:31 -0300
|
||
|
Subject: [PATCH] avformat/avformat: also clear FFFormatContext packet queue
|
||
|
when closing a muxer
|
||
|
|
||
|
packet_buffer is used in mux.c, and if a muxing process fails at a point where
|
||
|
packets remained in said queue, they will leak.
|
||
|
|
||
|
Fixes ticket #11419
|
||
|
|
||
|
Signed-off-by: James Almer <jamrial@gmail.com>
|
||
|
---
|
||
|
libavformat/avformat.c | 1 +
|
||
|
1 file changed, 1 insertion(+)
|
||
|
|
||
|
--- a/libavformat/utils.c
|
||
|
+++ b/libavformat/utils.c
|
||
|
@@ -4478,6 +4478,7 @@
|
||
|
av_dict_free(&s->internal->id3v2_meta);
|
||
|
av_packet_free(&s->internal->pkt);
|
||
|
av_packet_free(&s->internal->parse_pkt);
|
||
|
+ avpriv_packet_list_free(&s->internal->packet_buffer, &s->internal->packet_buffer_end);
|
||
|
av_freep(&s->streams);
|
||
|
flush_packet_queue(s);
|
||
|
av_freep(&s->internal);
|