tx encryption: do not send invalid frame

If encryption fails, do not pass the data further since it will abort
on data_len <= 0 assertion in RTP.
This commit is contained in:
Martin Pulec
2024-08-06 15:42:38 +02:00
parent f4bebb27b0
commit 9dccd8a3f7

View File

@@ -755,6 +755,9 @@ tx_send_base(struct tx *tx, struct video_frame *frame, struct rtp *rtp_session,
? sizeof(fec_payload_hdr_t)
: sizeof(video_payload_hdr_t),
encrypted_data);
if (data_len <= 0) {
return;
}
data = encrypted_data;
}
@@ -888,6 +891,9 @@ audio_tx_send_chan(struct tx *tx, struct rtp *rtp_session, uint32_t timestamp,
(char *) rtp_hdr,
rtp_hdr_len - sizeof(crypto_payload_hdr_t),
encrypted_data);
if (data_len <= 0) {
return;
}
data = encrypted_data;
}