mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-21 14:47:31 +09:00
WebRTC: Nullcheck DataChannel SendPacket calls.
This commit is contained in:
parent
f5d85dbba6
commit
ea5ece2be9
2 changed files with 5 additions and 2 deletions
|
|
@ -654,7 +654,10 @@ int
|
||||||
DataChannelConnection::SendPacket(unsigned char data[], size_t len, bool release)
|
DataChannelConnection::SendPacket(unsigned char data[], size_t len, bool release)
|
||||||
{
|
{
|
||||||
//LOG(("%p: SCTP/DTLS sent %ld bytes", this, len));
|
//LOG(("%p: SCTP/DTLS sent %ld bytes", this, len));
|
||||||
int res = mTransportFlow->SendPacket(data, len) < 0 ? 1 : 0;
|
int res = 0;
|
||||||
|
if (mTransportFlow) {
|
||||||
|
res = mTransportFlow->SendPacket(data, len) < 0 ? 1 : 0;
|
||||||
|
}
|
||||||
if (release)
|
if (release)
|
||||||
delete [] data;
|
delete [] data;
|
||||||
return res;
|
return res;
|
||||||
|
|
|
||||||
|
|
@ -111,7 +111,7 @@ public:
|
||||||
virtual void NotifyDataChannel(already_AddRefed<DataChannel> channel) = 0;
|
virtual void NotifyDataChannel(already_AddRefed<DataChannel> channel) = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
explicit DataChannelConnection(DataConnectionListener *listener);
|
DataChannelConnection(DataConnectionListener *listener);
|
||||||
|
|
||||||
bool Init(unsigned short aPort, uint16_t aNumStreams, bool aUsingDtls);
|
bool Init(unsigned short aPort, uint16_t aNumStreams, bool aUsingDtls);
|
||||||
void Destroy(); // So we can spawn refs tied to runnables in shutdown
|
void Destroy(); // So we can spawn refs tied to runnables in shutdown
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue