Commit 57e2c3ed authored by Sven Liefgen's avatar Sven Liefgen
Browse files

Update prrt/proto/types/packet.c

parent 1dc086e5
Pipeline #4560 failed with stages
in 46 seconds
......@@ -146,8 +146,7 @@ bool PrrtPacket_encode_payload(void *buf_ptr, PrrtPacket *packet_ptr) {
}
bool PrrtPacket_encode(void *buf_ptr, uint16_t buf_size, PrrtPacket *packet_ptr) {
void *payload = packet_ptr->payload;
check(packet_ptr->payloadLength + PRRT_PACKET_ENCODED_GENERAL_HEADER_LENGTH <= buf_size, "Buffer too small.");
buf_ptr = encode_general_header(buf_ptr, packet_ptr);
......@@ -225,7 +224,7 @@ bool PrrtPacket_decode_payload(void *srcBuffer, prrtPacketType_t packetType, voi
srcBuffer = decode_data_header(srcBuffer, payload);
memcpy(payload + PRRT_PACKET_DATA_HEADER_SIZE, srcBuffer, payload_len - PRRT_PACKET_DATA_HEADER_SIZE);
} else if (packetType == PACKET_TYPE_REDUNDANCY) {
srcBuffer = decode_redundancy_header(srcBuffer, targetPacket->payload);
srcBuffer = decode_redundancy_header(srcBuffer, payload);
memcpy(payload + PRRT_PACKET_REDUNDANCY_HEADER_SIZE, srcBuffer, payload_len - PRRT_PACKET_REDUNDANCY_HEADER_SIZE);
} else if (packetType == PACKET_TYPE_FEEDBACK) {
decode_feedback_header(srcBuffer, payload);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment