mirror of
https://github.com/cberner/raptorq.git
synced 2024-06-16 11:59:01 +00:00
Fix division by zero when packet size is less than 32
This commit is contained in:
parent
378baee78e
commit
7939144ef8
@ -202,10 +202,13 @@ impl ObjectTransmissionInformation {
|
||||
max_packet_size: u16,
|
||||
decoder_memory_requirement: u64,
|
||||
) -> ObjectTransmissionInformation {
|
||||
let alignment = 8;
|
||||
let (alignment, sub_symbol_size) = if max_packet_size >= 8 * 8 {
|
||||
(8, 8)
|
||||
} else {
|
||||
(1, 1)
|
||||
};
|
||||
assert!(max_packet_size >= alignment);
|
||||
let symbol_size = max_packet_size - (max_packet_size % alignment);
|
||||
let sub_symbol_size = 8;
|
||||
|
||||
let kt = int_div_ceil(transfer_length, symbol_size as u64);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user