mirror of
https://github.com/oxen-io/session-android.git
synced 2024-11-23 18:15:22 +00:00
Drop malformed RTP packets
// FREEBIE
This commit is contained in:
parent
85ea7e1bf4
commit
8f256fa285
@ -26,6 +26,11 @@ RtpPacket* RtpAudioReceiver::receive(char* encodedData, int encodedDataLen) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (received < RtpPacket::getMinimumSize()) {
|
||||
__android_log_print(ANDROID_LOG_WARN, TAG, "recveived malformed packet!");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
RtpPacket *packet = new RtpPacket(encodedData, received);
|
||||
|
||||
if (srtpStream.decrypt(*packet, sequenceCounter.convertNext(packet->getSequenceNumber())) != 0) {
|
||||
|
@ -21,6 +21,10 @@ public:
|
||||
RtpPacket(char *payload, int payloadLen, int sequenceNumber, int timestamp);
|
||||
~RtpPacket();
|
||||
|
||||
static int getMinimumSize() {
|
||||
return sizeof(RtpHeader);
|
||||
}
|
||||
|
||||
uint16_t getSequenceNumber();
|
||||
int getPayloadType();
|
||||
uint32_t getTimestamp();
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue
Block a user