<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style></head>
<body class='hmmessage'><div dir='ltr'>
<pre style="background-color: rgb(255, 255, 255); "><pre><font color="#2a2a2a"><span style="line-height: 17px; white-space: normal;">> </span></font></pre><pre><font color="#2a2a2a"><span style="line-height: 17px; white-space: normal;">> > If Matroska if is not exist the program will crash.</span></font></pre><pre><font color="#2a2a2a"><span style="line-height: 17px; white-space: normal;">> > </span></font></pre><pre><font color="#2a2a2a"><span style="line-height: 17px; white-space: normal;">> > 1. In MatroskaFile.cpp </span></font></pre><pre><font color="#2a2a2a"><span style="line-height: 17px; white-space: normal;">> > </span></font></pre><pre><font color="#2a2a2a"><span style="line-height: 17px; white-space: normal;">> > fParserForInitialization</span></font></pre><pre><font color="#2a2a2a"><span style="line-height: 17px; white-space: normal;">> > = new MatroskaFileParser(*this, ByteStreamFileSource::createNew(envir(), fileName),</span></font></pre><pre><font color="#2a2a2a"><span style="line-height: 17px; white-space: normal;">> > handleEndOfTrackHeaderParsing, this, NULL); </span></font></pre><pre><font color="#2a2a2a"><span style="line-height: 17px; white-space: normal;">> [...]</span></font></pre><pre><font color="#2a2a2a"><span style="line-height: 17px; white-space: normal;">> > // if Matroska file is not exist, the fParserForInitialization is a invalid pointer.</span></font></pre><pre><font color="#2a2a2a"><span style="line-height: 17px; white-space: normal;">> </span></font></pre><pre><font color="#2a2a2a"><span style="line-height: 17px; white-space: normal;">> No, that should not be the case. If the file "fileName" does not exist, then the call to "ByteStreamFileSource::createNew(envir(), fileName)" will return NULL, and therefore the "MatroskaFileParser" constructor will be called with an "inputSource" parameter of NULL. This will cause the "fInputSource" member variable to get set to NULL. That should be OK, because we always check that "fInputSource" is NULL before we try to dereference it. But in any case, a valid "MatroskaFileParser" object should be constructed, and thus "fParserForInitialization" should be valid (and non-NULL).</span></font></pre><pre><font color="#2a2a2a"><span style="line-height: 17px; white-space: normal;">> </span></font></pre><pre><font color="#2a2a2a"><span style="line-height: 17px; white-space: normal;">> I won't rule out the possibility of there being some problem with the code if the file "fileName" does not exist, but if there is, then it's not what you described.</span></font></pre><pre><font color="#2a2a2a"><span style="line-height: 17px; white-space: normal;">> </span></font></pre><pre><font color="#2a2a2a"><span style="line-height: 17px; white-space: normal;">> </span></font></pre><pre><font color="#2a2a2a"><span style="line-height: 17px; white-space: normal;"><br></span></font></pre><pre><font color="#2a2a2a"><span style="line-height: 17px; white-space: normal;">Yes, If the file "filename" does not exist, then "ByteStreamFileSource::createNew(envir(), fileName)" will return NULL, and therefore the "MatroskaFileParser" constructor will be called with an "inputSource" parameter of NULL. This will cause the "fInputSource" member variable to get set to NULL. </span></font></pre><pre><font color="#2a2a2a"><span style="line-height: 17px; white-space: normal;"><br></span></font></pre><pre><font color="#2a2a2a"><span style="line-height: 17px; white-space: normal;">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.</span></font></pre><pre><font color="#2a2a2a"><span style="line-height: 17px; white-space: normal;"><br></span></font></pre><pre><font color="#2a2a2a"><span style="line-height: 17px; white-space: normal;">note: I create a solution in vs 2008 ,and i add the file into the solution, I can complie and build the solution, If I need additions settings?</span></font></pre><pre><font color="#2a2a2a"><span style="line-height: 17px; white-space: normal;"><br></span></font></pre><pre><font color="#2a2a2a"><span style="line-height: 17px; white-space: normal;">thanks.</span></font></pre></pre>                                      </div></body>
</html>