]> git.sesse.net Git - ffmpeg/commit
avformat/segment: Fix leak of duration/framenumber lists upon error
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Sat, 5 Sep 2020 17:36:31 +0000 (19:36 +0200)
committerAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Thu, 10 Sep 2020 11:24:58 +0000 (13:24 +0200)
commit4b836c86132feb67ca10e383988884dd67bcd19a
tree864db13cc2d464319025ff790ce549db5aadab49
parent92c8b79b5acc06ec608b4c5a2b1ff428dfa1a810
avformat/segment: Fix leak of duration/framenumber lists upon error

The code to free them is not in the segment muxer's deinit function,
but in its write_trailer function which means that these lists leak if
write_trailer isn't called after their allocation. This happens e.g. if
the given lists are invalid (e.g. consisting only of ',' (which delimit
entries)), so that parsing them fails and so does the muxer's init
function; write_trailer is then never called.

This has been fixed by moving the code to free them to the deinit
function.

Reviewed-by: Ridley Combs <rcombs@rcombs.me>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
libavformat/segment.c