From dde0d5557275f4ba572fb31b8b23271e45592420 Mon Sep 17 00:00:00 2001 From: Matthias Grundmann Date: Fri, 14 Apr 2017 11:24:02 -0700 Subject: [PATCH] Fix memory in MP4Modify Fix memory leak caused by calling MP4Modify(). This is caused by a "free" atom getting removed without de-allocating. --- src/mp4file.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/mp4file.cpp b/src/mp4file.cpp index 86f386b..8b6946c 100644 --- a/src/mp4file.cpp +++ b/src/mp4file.cpp @@ -190,6 +190,9 @@ bool MP4File::Modify( const char* fileName ) // get rid of any trailing free or skips if (!strcmp(type, "free") || !strcmp(type, "skip")) { m_pRootAtom->DeleteChildAtom(pAtom); + // Deallocate the atom after removing. + delete pAtom; + continue; }