Fixed invalid type

This commit is contained in:
WolverinDEV 2019-11-22 20:59:12 +01:00
parent ebb382cc40
commit 47a8b537ca

View File

@ -15,7 +15,7 @@ bool CompressionHandler::compress(protocol::BasicPacket* packet, std::string &er
auto packet_payload = packet->data();
auto header_length = packet->length() - packet_payload.length();
size_t max_compressed_payload_size = max(min(packet_payload.length() * 2, packet_payload.length() + 400ULL), 24ULL); /* at least 12 bytes (QLZ header) */
size_t max_compressed_payload_size = max(min(packet_payload.length() * 2, (size_t) (packet_payload.length() + 400ULL)), (size_t) 24ULL); /* at least 12 bytes (QLZ header) */
auto target_buffer = buffer::allocate_buffer(max_compressed_payload_size + header_length);
qlz_state_compress state_compress{};