Revamp exception handling. ImportErrorException renamed to DeadlyImportError to avoid silent regressions. Exceptions now thrown by value, and caught by reference. Put guards in all C++ and C API functions to avoid unwanted exception propagation across module and language boundaries.
PLEASE TEST CAREFULLY IF THIS SHOULD CAUSE REGRESSIONS. git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@617 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
This commit is contained in:
@@ -132,7 +132,7 @@ void Discreet3DSImporter::InternReadFile( const std::string& pFile,
|
||||
|
||||
// We should have at least one chunk
|
||||
if (stream.GetRemainingSize() < 16) {
|
||||
throw new ImportErrorException("3DS file is either empty or corrupt: " + pFile);
|
||||
throw DeadlyImportError("3DS file is either empty or corrupt: " + pFile);
|
||||
}
|
||||
|
||||
// Allocate our temporary 3DS representation
|
||||
@@ -220,7 +220,7 @@ void Discreet3DSImporter::ReadChunk(Discreet3DS::Chunk* pcOut)
|
||||
pcOut->Size = stream->GetI4();
|
||||
|
||||
if (pcOut->Size - sizeof(Discreet3DS::Chunk) > stream->GetRemainingSize())
|
||||
throw new ImportErrorException("Chunk is too large");
|
||||
throw DeadlyImportError("Chunk is too large");
|
||||
|
||||
if (pcOut->Size - sizeof(Discreet3DS::Chunk) > stream->GetRemainingSizeToLimit())
|
||||
DefaultLogger::get()->error("3DS: Chunk overflow");
|
||||
|
||||
Reference in New Issue
Block a user