momo0853 / mp4v2

mp4v2 for android
Other
19 stars 20 forks source link

Memory leaks #83

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. open an ALAC file using MP4Read()
2. optionally call MP4GetMetadataFreeForm(...)
3. call MP4Close() right away

What is the expected output? What do you see instead?

i expect there is no memory leak :) there is several.

What version of the product are you using? On what operating system?

windows x64 sp2

Please provide any additional information below.

in class MP4SoundAtom in function Read() there are 9 properties removed from 
m_pProperties without being properly deleted. adding the following two lines 
fixes the problem:

      for(int i = 0; i < 9; ++ i)
          delete m_pProperties[i];

i just verified it, and it is present in the newest release as well.
there are more memory leaks caused by MP4GetMetadataFreeForm(), at:

mp4meta.cpp, line 85 and mp4meta.cpp, line 926,
the pointer pV must be deleted ("N.B. caller must free memory")

Original issue reported on code.google.com by the.swin...@gmail.com on 13 Feb 2011 at 3:34

GoogleCodeExporter commented 8 years ago
oh, sorry ... the mp4meta.cpp bugs seem to be fixed now. my bad.

Original comment by the.swin...@gmail.com on 13 Feb 2011 at 3:38

GoogleCodeExporter commented 8 years ago
Are any of these leaks present in trunk?

Original comment by kid...@gmail.com on 2 Mar 2011 at 6:59

GoogleCodeExporter commented 8 years ago
oh yeah ... here they are (mp4_sound.cpp, line 102):

        // Quicktime has an interesting thing - they'll put an mp4a atom
        // which is blank inside a wave atom, which is inside an mp4a atom
        // we have a mp4a inside an wave inside an mp4a - delete all properties
        m_pProperties.Delete(8);
        m_pProperties.Delete(7);
        m_pProperties.Delete(6);
        m_pProperties.Delete(5);
        m_pProperties.Delete(4);
        m_pProperties.Delete(3);
        m_pProperties.Delete(2);
        m_pProperties.Delete(1);
        m_pProperties.Delete(0);

the deleted properties are not being freed.
and since there's no mp4_meta.cpp in the trunk, i guess these leaks are not 
present in there.

Original comment by the.swin...@gmail.com on 2 Mar 2011 at 9:51

GoogleCodeExporter commented 8 years ago
Should be fixed in r465.  Thanks.

Original comment by kid...@gmail.com on 15 May 2011 at 12:03

GoogleCodeExporter commented 8 years ago

Original comment by kid...@gmail.com on 15 May 2011 at 12:03