You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-10 06:10:52 +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:
committed by
Michael Niedermayer
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.
|
* Free the members allocated in the mux context.
|
||||||
*/
|
*/
|
||||||
static void mkv_free(MatroskaMuxContext *mkv) {
|
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) {
|
if (mkv->main_seekhead) {
|
||||||
av_freep(&mkv->main_seekhead->entries);
|
av_freep(&mkv->main_seekhead->entries);
|
||||||
av_freep(&mkv->main_seekhead);
|
av_freep(&mkv->main_seekhead);
|
||||||
|
Reference in New Issue
Block a user