Alexander Medvedev
2026-03-08 21:39:26 +01:00
parent 4aaaea7cc7
commit 004a41625f

View File

@@ -102,7 +102,8 @@ impl<R: Read> NetworkReadExt for R {
get_number_be!(get_f64_be, f64);
fn read_boxed_slice(&mut self, length: usize) -> Result<Box<[u8]>, ReadingError> {
const MAX_SLICE_LENGTH: usize = 2 * 1024 * 64; // 64KB, largest valid MC packet
// Increase this to at least 2MB to handle larger Bedrock batches
const MAX_SLICE_LENGTH: usize = 2 * 1024 * 1024; // 2MB
if !(1..=MAX_SLICE_LENGTH).contains(&length) {
return Err(ReadingError::Message(format!(
"read_boxed_slice: length {length} out of bounds"