SIMDCompressionAndIntersection
                                
                                 SIMDCompressionAndIntersection copied to clipboard
                                
                                    SIMDCompressionAndIntersection copied to clipboard
                            
                            
                            
                        Wanted: Exception when provided an insufficient buffer
When trying to decode data using uncompress function I receive an Unhandled exception (Access violation).
The size sending to function is too small, and I expected to get NotEnoughStorage exception so the buffer will resize to the right uncompressed size.
I have renamed the issue.
To be clear, currently, you can avoid this problem during encoding by providing sufficient buffer memory. For example, if you allocate 2x the original memory plus, say, 1024, you will never run out.
During decoding, the current API assumes that you know the size of the uncompressed array.
I don't know what is the original size before it was encoded. in this case, what should be the multiplier to allocate size by decoded data size.
+1 for how to calculate the decompressed size if you only have compressed size.
This issue is marked as "help wanted" and there is nobody working on it as far as I know.
I'm wondering if the easiest way would be to put the uncompressed length at the start of the encoded buffer (just as a plain uint32_t).
@cs96and
I'm wondering if the easiest way would be to put the uncompressed length at the start of the encoded buffer (just as a plain uint32_t).
It generally works this way already. It is not a format problem, it is an API issue.
I created a new issue https://github.com/lemire/SIMDCompressionAndIntersection/issues/20