> If Matroska if is not exist the program will crash.
> 
> 1. In MatroskaFile.cpp 
> 
> fParserForInitialization
>               = new MatroskaFileParser(*this, 
> ByteStreamFileSource::createNew(envir(), fileName),
>               handleEndOfTrackHeaderParsing, this, NULL);   
[...]
> // if Matroska file is not exist, the fParserForInitialization is a invalid 
> pointer.

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).

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.


Ross Finlayson
Live Networks, Inc.
http://www.live555.com/

_______________________________________________
live-devel mailing list
[email protected]
http://lists.live555.com/mailman/listinfo/live-devel

Reply via email to