Open Ratio2 opened 1 month ago
Note that this does not happen if you try to read the actual number of bytes with data = file.get_buffer(size)
, only when you try to read more than the data in the file, but it is specific to compressed files
This is due to past changes to handle some variable storage, but seems to handle things incorrectly in some cases, will look at a fix
Though I think specifically the issue is due to an error arising when doing modulo on the result, will test
Edit: Seems to work, running tests and will open a PR if it works correctly
Tested versions
Reproducible in: 4.1.2, 4.1.4, 4.2.2, 4.3rc1, master
System information
Any
Issue description
If the size of the original data for compression is a multiple of 4096, then when reading the data, an extra random byte appears at the end. The decompression code does not take into account that the last block may be of size zero.
Steps to reproduce
Minimal reproduction project (MRP)
N/A