mirror of
https://git.videolan.org/git/ffmpeg.git
synced 2024-10-02 09:09:59 +02:00
lavf/matroskaenc.c: Free dyn bufs in mkv_free. Fixes memory leaks when muxing fails.
Signed-off-by: Sasi Inguva <isasi@google.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
d1df72a702
commit
e4a1d87ef8
@ -393,6 +393,23 @@ static void put_xiph_size(AVIOContext *pb, int size)
|
||||
* Free the members allocated in the mux context.
|
||||
*/
|
||||
static void mkv_free(MatroskaMuxContext *mkv) {
|
||||
uint8_t* buf;
|
||||
if (mkv->dyn_bc) {
|
||||
avio_close_dyn_buf(mkv->dyn_bc, &buf);
|
||||
av_free(buf);
|
||||
}
|
||||
if (mkv->info_bc) {
|
||||
avio_close_dyn_buf(mkv->info_bc, &buf);
|
||||
av_free(buf);
|
||||
}
|
||||
if (mkv->tracks_bc) {
|
||||
avio_close_dyn_buf(mkv->tracks_bc, &buf);
|
||||
av_free(buf);
|
||||
}
|
||||
if (mkv->tags_bc) {
|
||||
avio_close_dyn_buf(mkv->tags_bc, &buf);
|
||||
av_free(buf);
|
||||
}
|
||||
if (mkv->main_seekhead) {
|
||||
av_freep(&mkv->main_seekhead->entries);
|
||||
av_freep(&mkv->main_seekhead);
|
||||
|
Loading…
Reference in New Issue
Block a user