Add debug_assert! that file end isn't before start

This commit is contained in:
Chris Hennick 2023-04-29 18:03:11 -07:00
parent ed5c76d2e8
commit 5d9296244c
No known key found for this signature in database
GPG key ID: 25653935CC8B6C74

View file

@ -471,6 +471,7 @@ impl<W: Write + Seek> ZipWriter<W> {
file.uncompressed_size = self.stats.bytes_written;
let file_end = writer.stream_position()?;
debug_assert!(file_end >= self.stats.start);
file.compressed_size = file_end - self.stats.start;
update_local_file_header(writer, file)?;