You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
LZ4BlockInputStream.available() returns a negative value after an empty block #108
In refill(), the empty-block branch (originalLen == 0 && compressedLen == 0) sets originalLen to 0 but leaves o at its value from the previous block. available() (return originalLen - o;, line 190) then returns -o. This happens with the default stopOnEmptyBlock=true too.
Fix: set o = 0 in the empty-block branch. Otherwise, clamp available() to at least 0.
Activity
Fix negative LZ4BlockInputStream.available() after an empty block (#129)