Permalink
Browse files

Drop malformed RTP packets

// FREEBIE
  • Loading branch information...
moxie0 committed Sep 12, 2016
1 parent 32c408d commit 8f576938d96733d44322029953e0c23551be5b5b
@@ -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) {
View
@@ -21,6 +21,10 @@ class RtpPacket {
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.

1 comment on commit 8f57693

@apapadop-zz

This comment has been minimized.

Show comment
Hide comment
@apapadop-zz

apapadop-zz Sep 16, 2016

Typo in tag of jni/redphone/RtpAudioReceiver.cpp:
"recveived malformed packet!" should be
"received malformed packet!"

apapadop-zz commented on 8f57693 Sep 16, 2016

Typo in tag of jni/redphone/RtpAudioReceiver.cpp:
"recveived malformed packet!" should be
"received malformed packet!"

Please sign in to comment.