1
2
Fork 0
mirror of https://github.com/mat-1/azalea.git synced 2025-08-02 14:26:04 +00:00

fix incorrect varlong reader

This commit is contained in:
mat 2024-06-11 09:48:11 +00:00
parent c7f9dc4b3d
commit dd2f0465a4

View file

@ -145,7 +145,7 @@ impl McBufVarReadable for i64 {
fn var_read_from(buf: &mut Cursor<&[u8]>) -> Result<Self, BufReadError> {
let mut buffer = [0];
let mut ans = 0;
for i in 0..8 {
for i in 0..10 {
buf.read_exact(&mut buffer)
.map_err(|_| BufReadError::InvalidVarLong)?;
ans |= ((buffer[0] & 0b0111_1111) as i64) << (7 * i);