Browse Source

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>
(cherry picked from commit c08d300481b8ebb846cd43a473988fdbc6793d1b)
James Almer 10 months ago
parent
commit
baee5f5e27
1 changed files with 1 additions and 0 deletions
  1. 1 0
      libavformat/avformat.c

+ 1 - 0
libavformat/avformat.c

@@ -184,6 +184,7 @@ void avformat_free_context(AVFormatContext *s)
     av_dict_free(&si->id3v2_meta);
     av_packet_free(&si->pkt);
     av_packet_free(&si->parse_pkt);
+    avpriv_packet_list_free(&si->packet_buffer);
     av_freep(&s->streams);
     av_freep(&s->stream_groups);
     ff_flush_packet_queue(s);