- format + fix invalid memory access
This commit is contained in:
parent
9d79c01be0
commit
e342abe2f5
|
|
@ -152,6 +152,8 @@ int RTPPacket::ParseRawPacket(RTPRawPacket &rawpack)
|
|||
|
||||
csrccount = rtpheader->csrccount;
|
||||
payloadoffset = sizeof(RTPHeader)+(int)(csrccount*sizeof(uint32_t));
|
||||
if ((size_t)payloadoffset > packetlen)
|
||||
return ERR_RTP_PACKET_INVALIDPACKET;
|
||||
|
||||
if (rtpheader->padding) // adjust payload length to take padding into account
|
||||
{
|
||||
|
|
@ -167,6 +169,8 @@ int RTPPacket::ParseRawPacket(RTPRawPacket &rawpack)
|
|||
{
|
||||
rtpextheader = (RTPExtensionHeader *)(packetbytes+payloadoffset);
|
||||
payloadoffset += sizeof(RTPExtensionHeader);
|
||||
if ((size_t)payloadoffset > packetlen)
|
||||
return ERR_RTP_PACKET_INVALIDPACKET;
|
||||
exthdrlen = ntohs(rtpextheader->length);
|
||||
payloadoffset += ((int)exthdrlen)*sizeof(uint32_t);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue