Skip to content

Commit

Permalink
Cherry-pick 272910@main (2404f7b). https://bugs.webkit.org/show_bug.c…
Browse files Browse the repository at this point in the history
…gi?id=267327

    [GStreamer][WebRTC] WPT test RTCPeerConnection-setLocalDescription-offer.html is crashing
    https://bugs.webkit.org/show_bug.cgi?id=267327

    Reviewed by Xabier Rodriguez-Calvar.

    Check the SDP message contains enough medias before attempting to access the one located at the
    given mline index.

    * Source/WebCore/Modules/mediastream/gstreamer/GStreamerMediaEndpoint.cpp:
    (WebCore::GStreamerMediaEndpoint::onIceCandidate):

    Canonical link: https://commits.webkit.org/272910@main
  • Loading branch information
philn authored and aperezdc committed Jan 28, 2024
1 parent 6a781d4 commit f5b4e00
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1443,9 +1443,9 @@ void GStreamerMediaEndpoint::onIceCandidate(guint sdpMLineIndex, gchararray cand
String mid;
GUniqueOutPtr<GstWebRTCSessionDescription> description;
g_object_get(m_webrtcBin.get(), "local-description", &description.outPtr(), nullptr);
if (description) {
if (const auto* media = gst_sdp_message_get_media(description->sdp, sdpMLineIndex))
mid = makeString(gst_sdp_media_get_attribute_val(media, "mid"));
if (description && sdpMLineIndex < gst_sdp_message_medias_len(description->sdp)) {
const auto media = gst_sdp_message_get_media(description->sdp, sdpMLineIndex);
mid = makeString(gst_sdp_media_get_attribute_val(media, "mid"));
}

auto descriptions = descriptionsFromWebRTCBin(m_webrtcBin.get());
Expand Down

0 comments on commit f5b4e00

Please sign in to comment.