Closed jeffreye closed 2 years ago
https://github.com/luben/zstd-jni/blob/1f04f24d02bd7c74c890b1325766b808fb353b4e/src/main/java/com/github/luben/zstd/ZstdDecompressCtx.java#L251
Expected:
The srcSize should be srcBuf.limit()-srcBuf.position()
srcSize
srcBuf.limit()-srcBuf.position()
e.g. https://github.com/luben/zstd-jni/blob/1f04f24d02bd7c74c890b1325766b808fb353b4e/src/main/java/com/github/luben/zstd/ZstdDecompressCtx.java#L238-L243
Actual:
This will throw srcSize is incorrect if srcBuf.position() isn't 0
srcSize is incorrect
srcBuf.position()
yes, you are right. Looks there was miss in testing as we used buffers with postition() == 0
postition() == 0
https://github.com/luben/zstd-jni/blob/1f04f24d02bd7c74c890b1325766b808fb353b4e/src/main/java/com/github/luben/zstd/ZstdDecompressCtx.java#L251
Expected:
The
srcSize
should besrcBuf.limit()-srcBuf.position()
e.g. https://github.com/luben/zstd-jni/blob/1f04f24d02bd7c74c890b1325766b808fb353b4e/src/main/java/com/github/luben/zstd/ZstdDecompressCtx.java#L238-L243
Actual:
This will throw
srcSize is incorrect
ifsrcBuf.position()
isn't 0