Coverity: fix finding in COBLoader.
parent
a2b8d66a86
commit
03d97b23ec
|
@ -941,20 +941,22 @@ void COBImporter::UnsupportedChunk_Binary( StreamReaderLE& reader, const ChunkIn
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
// tiny utility guard to aid me at staying within chunk boundaries.
|
// tiny utility guard to aid me at staying within chunk boundaries.
|
||||||
class chunk_guard {
|
class chunk_guard {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
chunk_guard(const COB::ChunkInfo& nfo, StreamReaderLE& reader)
|
chunk_guard(const COB::ChunkInfo& nfo, StreamReaderLE& reader)
|
||||||
: nfo(nfo)
|
: nfo(nfo)
|
||||||
, reader(reader)
|
, reader(reader)
|
||||||
, cur(reader.GetCurrentPos())
|
, cur(reader.GetCurrentPos()) {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
~chunk_guard() {
|
~chunk_guard() {
|
||||||
// don't do anything if the size is not given
|
// don't do anything if the size is not given
|
||||||
if(nfo.size != static_cast<unsigned int>(-1)) {
|
if(nfo.size != static_cast<unsigned int>(-1)) {
|
||||||
|
try {
|
||||||
reader.IncPtr( static_cast< int >( nfo.size ) - reader.GetCurrentPos() + cur );
|
reader.IncPtr( static_cast< int >( nfo.size ) - reader.GetCurrentPos() + cur );
|
||||||
|
} catch ( DeadlyImportError e ) {
|
||||||
|
// out of limit so correct the value
|
||||||
|
reader.IncPtr( reader.GetReadLimit() );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue