Comments (3)
Yes it's a known behavior, decompression actually needs at least DENSITY_CHAMELEON_DECODE_MINIMUM_OUTPUT_LOOKAHEAD or DENSITY_MANDALA_DECODE_MINIMUM_OUTPUT_LOOKAHEAD bytes to continue processing.
I don't know if this can be filed as a problem or not, because you just need a few hundred extra bytes or trick the decompressor into thinking it has the bytes available for everything to work properly.
In your case, if you use LOREM_IPSUM_LENGTH + DENSITY_CHAMELEON_DECODE_MINIMUM_OUTPUT_LOOKAHEAD as the decompressed buffer length, everything will work, but I agree it's not ideal.
from density.
For a simple test case like this that would work, but there are plenty of cases where that's not feasible and you would really have no choice but to decompress to a temporary buffer then memcpy over to the real buffer. I would actually guess that most people who would be interested in the buffer to buffer API would fall into that case.
Maybe you could provide *_fast and *_safe versions of the API (kind of like LZ4, as well as some others)? Or tweak the implementation so that the last block decompresses to a temporary buffer if there is not enough space available to decompress it directly to the supplied buffer?
from density.
Implemented in 9e28aa5
from density.
Related Issues (20)
- Extremely large compiled size HOT 2
- Division by zero in the encoder HOT 1
- decompress error HOT 1
- type qualifier on return type is meaningless
- Crashes from fuzzing HOT 2
- densityxx is a C++ version of density HOT 3
- Windows compilation HOT 3
- Use of unnamed union HOT 2
- MSVC compiler port HOT 2
- Setup continuous integration HOT 1
- Verify decompressed data consistency in benchmark
- Problems with the density_context by multiple uses HOT 23
- why don`t you make standalone binaries ? HOT 5
- Decompression error with dev branch HOT 13
- Flattening of directory hierarchy ? HOT 1
- make install target HOT 1
- Creating a C++/CLI wrapper for C#
- Rust port HOT 23
- API issue: density_decompress () requires a larger buffer than needed to store the decompressed data HOT 3
- Bug and Security
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from density.