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.
|
||||
class chunk_guard {
|
||||
|
||||
public:
|
||||
|
||||
chunk_guard(const COB::ChunkInfo& nfo, StreamReaderLE& reader)
|
||||
: nfo(nfo)
|
||||
, reader(reader)
|
||||
, cur(reader.GetCurrentPos())
|
||||
{
|
||||
, cur(reader.GetCurrentPos()) {
|
||||
}
|
||||
|
||||
~chunk_guard() {
|
||||
// don't do anything if the size is not given
|
||||
if(nfo.size != static_cast<unsigned int>(-1)) {
|
||||
try {
|
||||
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