Skip to content

Commit

Permalink
fix crash on 0 byte RTCP packet
Browse files Browse the repository at this point in the history
  • Loading branch information
willamowius committed Jan 5, 2021
1 parent 125b097 commit bc0287b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/h460/h46018_h225.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -1352,9 +1352,9 @@ PBoolean H46019UDPSocket::WriteMultiplexBuffer(const void * buf, PINDEX len, con
m_multiMutex.Signal();
m_multiBuffer++;

if (!rtpSocket) {
if (!rtpSocket && len > 0) {
RTP_ControlFrame frame(len);
memcpy(frame.GetPointer(),buf,len);
memcpy(frame.GetPointer(), buf, len);
if (frame.GetPayloadType() == RTP_ControlFrame::e_ApplDefined) {
PTRACE(6, "H46024A\tReading RTCP Probe Packet.");
PBYTEArray tempData;
Expand Down
3 changes: 2 additions & 1 deletion src/rtp.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,8 @@ RTP_ControlFrame::RTP_ControlFrame(PINDEX sz)
{
compoundOffset = 0;
compoundSize = 0;
theArray[0] = '\x80'; // Set version 2
if (sz > 0)
theArray[0] = '\x80'; // Set version 2
}


Expand Down

0 comments on commit bc0287b

Please sign in to comment.