]> git.sesse.net Git - ffmpeg/commit
avformat/utils: Fix memleaks in avformat_open_input()
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Tue, 7 Jan 2020 13:55:47 +0000 (14:55 +0100)
committerMarton Balint <cus@passwd.hu>
Sat, 15 Feb 2020 17:25:51 +0000 (18:25 +0100)
commite2307f4ff197646a7feee0edbcdd2d3262932676
tree9e16d6324ca9a7664bfb321f36e10399578c7726
parent9e6ee46c7d90edcd51546fb0ba69151960c48f71
avformat/utils: Fix memleaks in avformat_open_input()

A demuxer might have allocated memory while reading the header. If
reading the header was successfull and an error happens before returning
(e.g. when queueing the attached pictures), the read_close function
would have never been called, so that all those allocations would leak.
This commit changes this.

Furthermore, there would be even more memleaks if the error level was
set to AV_EF_EXPLODE in case there is both metadata and id3v2 metadata.
This has been fixed, too.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: Marton Balint <cus@passwd.hu>
libavformat/utils.c