[Live-devel] Problem! If Matroska file not exist

kingking kuo kevinkuokingking at hotmail.com
Tue Aug 28 19:12:47 PDT 2012



> 
> > but, In void MatroskaFileParser::continueParsing() call, the "if (fOnEndFunc != NULL) (*fOnEndFunc)(fOnEndClientData);" will call, then will call "void MatroskaFile::handleEndOfTrackHeaderParsing()", and this time the "fParserForInitialization" is a invalid pointer, delete the invalid pointer will crash.
> 
> Unfortunately you're still describing the *symptoms* of an apparent bug, but I'm not seeing the *cause* of the bug.  There are only two possible ways that the "fParserForInitialization" pointer could become invalid:
> 1/ "handleEndOfTrackHeaderParsing()" is being called on a "MatroskaFile" object after its destructor has already been called, or
> 2/ Something is (somehow) writing over the "fParserForInitialization" field in (what would otherwise be) a still-valid "MatroskaFile" object.
> 
> So I now need to know which of these is happening, and why.
> 


The reason is destructor "fParserForInitialization" before its Init complete, If "MatroskaFile" is not exist.
see following setps.
1. "MatroskaFile" construct function
{
       2. fParserForInitialization = new MatroskaFileParser()
       {             3. call MatroskaFileParser's construct funciton
             4. call MatroskaFileParser's member function "continueParsing" (when MatroskaFile is not exist, the fInputSource is NULL, but fOnEndFunc is not NULL, so continue next setup.)
            5. call MatroskaFile's member function "handleEndOfTrackHeaderParsing"
            6. call delete fParserForInitialization. (but this time fParserForInitialization Initialize is not completed, the MatroskaFileParser's construct function is not return, so fParserForInitialization is a invalid pointer)       }
} 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.live555.com/pipermail/live-devel/attachments/20120829/c532bc74/attachment.html>


More information about the live-devel mailing list