eagleflo/mpyq — pull request #26 by GraylinKim (2014-01-05 17:57:16+00:00)
Title: Compare with bytes left when checking compression.

The last sector of a file may be uncompressed if the sector length is less than or equal to the the number of bytes remaining. I've added an s2ma file to the test folder that demonstrates this issue.

See: https://github.com/stormlib/StormLib/blob/master/src/SFileReadFile.cpp#L109

Their logic is a little convoluted, but they cut down the expected sector size if the last sector isn't big enough. This causes the compression check down on [L159](https://github.com/stormlib/StormLib/blob/master/src/SFileReadFile.cpp#L159) to fail.