Skip to content

Commit 7d01109

Browse files
fix: reencoding a format version 0 file causes corruption
Fortunately, these are relatively rare... there's some bug in the c++ code when dealing with version 0.
1 parent 498f178 commit 7d01109

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

crackle_cli/cli.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,11 @@ def compress_file(src, allow_pins, markov, gzip, keep):
191191
dest += ".gz"
192192

193193
if is_crackle:
194+
if data.header().format_version == 0:
195+
# This causes file corruption for some reason. Requires more extensive inquiry.
196+
print("Reencoding format version 0 is not currently supported.")
197+
return
198+
194199
data.binary = crackle.codec.reencode(data.binary, markov_model_order=int(markov))
195200
data.save(dest)
196201
else:

0 commit comments

Comments
 (0)