mirror of https://github.com/vitalif/zbackup
parent
e059230ff1
commit
854c8b769a
|
@ -126,6 +126,7 @@ void Creator::write( std::string const & fileName, EncryptionKey const & key )
|
|||
int size;
|
||||
if ( !os.Next( &data, &size ) )
|
||||
{
|
||||
encoder.reset();
|
||||
throw exBundleWriteFailed();
|
||||
}
|
||||
if ( !size )
|
||||
|
@ -142,6 +143,8 @@ void Creator::write( std::string const & fileName, EncryptionKey const & key )
|
|||
}
|
||||
}
|
||||
|
||||
encoder.reset();
|
||||
|
||||
os.writeAdler32();
|
||||
}
|
||||
|
||||
|
@ -179,6 +182,7 @@ Reader::Reader( string const & fileName, EncryptionKey const & key, bool prohibi
|
|||
int size;
|
||||
if ( !is.Next( &data, &size ) )
|
||||
{
|
||||
decoder.reset();
|
||||
throw exBundleReadFailed();
|
||||
}
|
||||
if ( !size )
|
||||
|
@ -195,10 +199,13 @@ Reader::Reader( string const & fileName, EncryptionKey const & key, bool prohibi
|
|||
if ( !decoder->getAvailableOutput() && decoder->getAvailableInput() )
|
||||
{
|
||||
// Apparently we have more data than we were expecting
|
||||
decoder.reset();
|
||||
throw exTooMuchData();
|
||||
}
|
||||
}
|
||||
|
||||
decoder.reset();
|
||||
|
||||
is.checkAdler32();
|
||||
|
||||
// Populate the map
|
||||
|
|
|
@ -59,6 +59,11 @@ public:
|
|||
|
||||
return ( ret == LZMA_STREAM_END );
|
||||
}
|
||||
|
||||
~LZMAEnDecoder()
|
||||
{
|
||||
lzma_end( &strm );
|
||||
}
|
||||
};
|
||||
lzma_stream LZMAEnDecoder::initValue = LZMA_STREAM_INIT;
|
||||
|
||||
|
|
Loading…
Reference in New Issue