Closed greatroar closed 2 years ago
In fact, just commenting out
if end > uint(len(dst)) {
// The remaining buffer may not hold 18 bytes.
// See https://github.com/pierrec/lz4/issues/51.
end = uint(len(dst))
}
makes it work, without TestIssue51 failing.
The following tries to decode into a buffer that is too short:
The asm decoders correctly detect that the output buffer is too short. The portable decoder returns 21, nil.
The problem is in "Shortcut 2" of the portable decoder. Commenting that out makes it work. It should probably require more space in dst, but that was removed as part of the fix for #51.