CompressFileToBlob: add an explicit seek to make sure we're at the start

This commit is contained in:
BhaaL 2017-01-21 21:27:25 +01:00
parent 30e0f3d9ca
commit 07d1f18f53
1 changed files with 2 additions and 0 deletions

View File

@ -216,6 +216,8 @@ bool CompressFileToBlob(const std::string& infile_path, const std::string& outfi
outfile.Seek(sizeof(CompressedBlobHeader), SEEK_CUR); outfile.Seek(sizeof(CompressedBlobHeader), SEEK_CUR);
// seek past the offset and hash tables (we will write them at the end) // seek past the offset and hash tables (we will write them at the end)
outfile.Seek((sizeof(u64) + sizeof(u32)) * header.num_blocks, SEEK_CUR); outfile.Seek((sizeof(u64) + sizeof(u32)) * header.num_blocks, SEEK_CUR);
// seek to the start of the input file to make sure we get everything
infile.Seek(0, SEEK_SET);
// Now we are ready to write compressed data! // Now we are ready to write compressed data!
u64 position = 0; u64 position = 0;