[FFmpeg-devel] [PATCH V1] lavf/matroskaenc: Fix memory leak after write trailer

Andreas Rheinhardt andreas.rheinhardt at googlemail.com
Thu Apr 4 16:04:00 EEST 2019


And I think that this memleak in mkv_write_trailer() has a twin in
mkv_write_packet(): Audio frames are not written directly, but rather
put into storage in cur_audio_pkt via av_packet_ref(). But if the
preceding audio packet was a zero size packet (but possibly with
side-data), then the preceding packet's side data will leak at this
point. A better solution seems to be never to store a packet whose
buffer has size zero in cur_audio_pkt. The only use we have for such
packets is to use them for mkv_check_new_extra_data() and that has
already been done at this point.

- Andreas


More information about the ffmpeg-devel mailing list