-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
16: Do not raise error if code equals range in get_bit r=gendx a=dragly It appears that code being equal to range is a valid state and that some files can have data encoded like this. An example of such a file has been added to the tests. ### Pull Request Overview This pull request fixes #15 ### Testing Strategy This pull request was tested by... - [ ] Added relevant unit tests. - [x] Added relevant end-to-end tests (such as `.lzma`, `.lzma2`, `.xz` files). ### Supporting Documentation and References The original data was produced by processing a randomly generated geometry with OpenCTM. OpenCTM files can contain embedded LZMA compressed data. This appears to be generated with the liblzma library. The data was then extracted to make a standalone file that is attached in this pull request. ### TODO or Help Wanted None Co-authored-by: Svenn-Arne Dragly <dragly@cognite.com> Co-authored-by: gendx <gendx@users.noreply.github.com> Co-authored-by: Svenn-Arne Dragly <s@dragly.com>
- Loading branch information
Showing
5 changed files
with
13,234 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Test files | ||
|
||
This folder contains a collection of test files to cover different use cases of the lzma-rs library. | ||
|
||
This README describes files that are not self-explanatory in this folder. | ||
|
||
## range-coder-edge-case | ||
|
||
This is a file that causes the code and range to be equal at some point during decoding LZMA data. | ||
Previously, this file would raise an `LZMAError("Corrupted range coding")`, although the file is a valid LZMA file. | ||
|
||
The file was created by generating random geometry in [Blender](1) using the Array and Build | ||
modifier on a cube. | ||
The geometry was then exported as an FBX file that was converted into OpenCTM using the 3D service | ||
in [Cognite Data Fusion](2). | ||
The vertices in the resulting OpenCTM file are LZMA-compressed. | ||
This LZMA-compressed section of the file was manually extracted and the header modified to include | ||
the unpacked size. | ||
The unpacked size is four times the vertex count found in the OpenCTM data. | ||
|
||
[1]: https://blender.org | ||
[2]: https://docs.cognite.com |
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters