unmap file when throw exception

This commit is contained in:
Xiao YiFang 2022-06-16 08:18:59 +08:00
parent f52251d640
commit 79e2f7c098

View file

@ -160,7 +160,10 @@ char * Reader::getBlock( uint32_t address, vector< char > & chunk )
if( uncompress( (unsigned char *)&chunk.front(), &decompressedLength, chunkDataBytes, compressedSize ) != Z_OK
|| decompressedLength != chunk.size() )
{
file.unmap( chunkDataBytes );
throw exFailedToDecompressChunk();
}
file.unmap( chunkDataBytes );
}