[FFmpeg-devel] [PATCH v2] avformat: call AVOutputFormat->deinit() when freeing the context

James Almer jamrial at gmail.com
Mon Oct 21 23:38:26 EEST 2019


On 10/20/2019 9:46 AM, James Almer wrote:
> Despite the doxy stating that it's called when the muxer is destroyed,
> this was not true in practice. It's only called by av_write_trailer()
> and on init() failure.
> 
> An AVFormatContext may be closed without writing the trailer if errors
> ocurred while muxing packets, so in order to prevent memory leaks, it
> should effectively be called when freeing the muxer.
> 
> Signed-off-by: James Almer <jamrial at gmail.com>
> ---
>  libavformat/mux.c   | 17 ++++++++++-------
>  libavformat/utils.c |  3 +++
>  2 files changed, 13 insertions(+), 7 deletions(-)

Applied.


More information about the ffmpeg-devel mailing list