fix: extract rtp capabilities crash - #218
Conversation
|
This is not the proper fix. Port could be != 0 and still there could be no a=ext lines and it would crash the same way. All the fields must be checked before iterating them. It's a global bug in that code. |
This reverts commit ebffdbd.
|
Got it, thanks. I applied an approach similar to the fix @richmonkey, who reported #192, made in his fork (richmonkey@a9578ad), but only guarding the arrays before iterating, as mediasoup-client does for All four arrays ( |
|
@AlexanderPanaev can you please run |
local |
|
Yes. Fixed. Can you please merge the latest v3? |
…p-capabilities-crash
Done. |
|
Thanks @AlexanderPanaev 👍 |
Fixes #192.
Hit this on Android, libmediasoupclient 3.5.0 + libwebrtc M140. Reproduces when the only m=audio section in the SDP is rejected and a video produce runs. We only got there by alternating the mic and camera buttons quickly.
The offer at that moment, the live video section and the rejected audio one:
Utils.cpp:136 then reads a key that is not there, on a const json&:
for (const auto& ext : m["ext"])The call is a video produce, but it dies on the audio section - the mic was off, so the only m=audio in the SDP was the rejected one.
[DEBUG] Handler::Send() | [kind:video, track->id():ARDAMSv0]
[TRACE] PeerConnection::CreateOffer()
[TRACE] Sdp::Utils::extractRtpCapabilities()
[ERROR] transport_jni::JNI_SendTransport_Produce() | [json.exception.type_error.305] cannot use operator[] with a string argument with number