[Live-devel] small leaks

Gabriel Bouvigne gabriel.bouvigne at resonate-mp4.com
Fri Aug 13 15:44:32 PDT 2004


Gabriel Bouvigne a écrit :

> I think that I might have idenfied some small leaks.

Another one that took me some time to find:

MPEG4GenericRTPSource.cpp, function processSpecialHeader(BufferedPacket* 
packet, unsigned& resultSpecialHeaderSize)


At some place there is:

     if (fNumAUHeaders > 0) {
       delete[] fAUHeaders;
       fAUHeaders = new AUHeader[fNumAUHeaders];
       // Fill in each header:
       BitVector bv(&headerStart[2], 0, AU_headers_length);
       fAUHeaders[0].size = bv.getBits(fSizeLength);
       fAUHeaders[0].index = bv.getBits(fIndexLength);



The delete should be moved at the beginning of the function, at this place:

   // default values:
   resultSpecialHeaderSize = 0;
   fNumAUHeaders = 0;
   fNextAUHeader = 0;
   delete[] fAUHeaders;
   fAUHeaders = NULL;

Otherwise the delete will not delete anything as the pointer is already 
set to NULL.


Regards,

-- 

Gabriel Bouvigne
Resonate mp4
Tel: (+33) 142 411 665


More information about the live-devel mailing list