Skip to content

Commit 671b1f9

Browse files
committed
fix: toxav rtp temp buffer allocation size was too large
and cast from 32bit to 16bit, causing a overflow and making the allocated size too small
1 parent 258148b commit 671b1f9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

toxav/rtp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -805,7 +805,7 @@ int rtp_send_data(RTPSession *session, const uint8_t *data, uint32_t length,
805805
header.flags |= RTP_KEY_FRAME;
806806
}
807807

808-
const uint16_t rdata_size = length + RTP_HEADER_SIZE + 1;
808+
const uint16_t rdata_size = min_u32(length + RTP_HEADER_SIZE + 1, MAX_CRYPTO_DATA_SIZE);
809809
VLA(uint8_t, rdata, rdata_size);
810810
memset(rdata, 0, rdata_size);
811811
rdata[0] = session->payload_type; // packet id == payload_type

0 commit comments

Comments
 (0)