fixed out of bound error

This commit is contained in:
Walter Oggioni committed 2020-05-02 00:31:12 +01:00
1 parent da433c9d14
commit c5d2ba03fa
1 file changed
+1 -1
@@ -98,7 +98,7 @@ public class ZstdInputStream extends InputStream {
break; break;
} else fill(); } else fill();
} }
int toBeRead = Math.min(len, output.pos.intValue() - output.dst.position()); int toBeRead = Math.min(len - totalRead, output.pos.intValue() - output.dst.position());
output.dst.get(arr, off + totalRead, toBeRead); output.dst.get(arr, off + totalRead, toBeRead);
totalRead += toBeRead; totalRead += toBeRead;
} }