Skip to content

Commit d99352b

Browse files
committed
fix[pack]: Don't decompress the delta when decompressing base objects.
It was already decompressed on line 285, so attempting to decompress it again turns the delta stream into garbage. Unfortunately I don't know enough about the git file format to make a test, the best I was able to do was to compare it to a reference implementation and see what was going wrong. Fixes #2344
1 parent 7c59cf4 commit d99352b

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

gix-pack/src/data/file/decode/entry.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,8 @@ impl File {
345345
let base_entry = cursor;
346346
debug_assert!(!base_entry.header.is_delta());
347347
object_kind = base_entry.header.as_kind();
348-
self.decompress_entry_from_data_offset(base_entry.data_offset, inflate, out)?;
348+
let out_base = &mut out[..out_size - total_delta_data_size];
349+
self.decompress_entry_from_data_offset(base_entry.data_offset, inflate, out_base)?;
349350
}
350351

351352
(first_buffer_size, second_buffer_end)

0 commit comments

Comments
 (0)