]> git.sesse.net Git - ffmpeg/commit
avformat/mux: Fix leaks on error when writing noninterleaved uncoded frames
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Sat, 11 Apr 2020 09:45:32 +0000 (11:45 +0200)
committerAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Fri, 17 Apr 2020 22:14:05 +0000 (00:14 +0200)
commit1004a92cd44404ad55a75509cd289a70fa03d333
treec768e95e7885ff765efb1873d0b595684d92bbd2
parentad1dc918a010d9d75e8babbe42a3996e1af00cb0
avformat/mux: Fix leaks on error when writing noninterleaved uncoded frames

If writing uncoded frames in noninterleaved mode fails at the preparatory
steps (i.e. before it reaches write_packet()), the packet would not be
unreferenced and the frame would leak. This is fixed by unreferencing
the packet in write_uncoded_frame_internal() instead.

This also makes it possible to remove the unreferencing in
write_packet() itself: In noninterleaved mode frames are now freed in
write_uncoded_frame_internal(), while they are freed in interleaved
mode when their containing packet gets unreferenced (like normal
packets).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
libavformat/mux.c