[FFmpeg-devel] [PATCH 6/7] fftools/ffmpeg_demux: Fix leak on error

Anton Khirnov anton at khirnov.net
Tue Oct 10 14:51:03 EEST 2023


Quoting Andreas Rheinhardt (2023-10-07 02:40:30)
> An AVFormatContext leaks on errors that happen before it is attached
> to its permanent place (an InputFile). Fix this by attaching
> it earlier.
> 
> Given that it is not documented that avformat_close_input() is usable
> with an AVFormatContext that has only been allocated with
> avformat_alloc_context() and not opened with avformat_open_input(),
> one error path before avformat_open_input() had to be treated
> specially: It uses avformat_free_context().
> 
> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>
> ---
>  fftools/ffmpeg_demux.c | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)

Ok

-- 
Anton Khirnov


More information about the ffmpeg-devel mailing list