sepfy / libpeer

WebRTC Library for IoT/Embedded Device using C
MIT License
863 stars 127 forks source link

Stack corruption if rtp packet size is 1400 #14

Open aldoshkind opened 2 years ago

aldoshkind commented 2 years ago

Hi @sepfy ! I found an issue in surveillance example which possibly affects overall pear usage. Default mtu size of rtph264pay is 1400 url RTP packet buffer size is 1400 also url peer_connection_send_rtp_packet uses srtp_protect inside, which writes outside of provided buffer, which leads to stack corruption: note in libsrtp docs. I think to avoid this the only option is to inreased buffer size, but I cannot deduce how huge it should be. Please review this problem.

sepfy commented 2 years ago

Thanks for the suggestion! Let me look into it.