Skip to content

Commit 78df714

Browse files
calvariseocanha
authored andcommitted
[EME][Thunder] Avoid crashing with null answers during session load
https://bugs.webkit.org/show_bug.cgi?id=296690 Reviewed by Philippe Normand. OpenCDM/Thunder can answer with a null message when loading a wrong session. We need to deal with that. * Source/WebCore/platform/graphics/gstreamer/eme/CDMThunder.cpp: (WebCore::CDMInstanceSessionThunder::loadSession): Canonical link: https://commits.webkit.org/298032@main
1 parent dd775c7 commit 78df714

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Source/WebCore/platform/graphics/gstreamer/eme/CDMThunder.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -624,7 +624,7 @@ void CDMInstanceSessionThunder::loadSession(LicenseType, const String& sessionID
624624
}
625625
} else {
626626
GST_ERROR("session %s not loaded", m_sessionID.utf8().data());
627-
if (responseMessage->isEmpty())
627+
if (!responseMessage || responseMessage->isEmpty())
628628
callback(std::nullopt, std::nullopt, std::nullopt, SuccessValue::Failed, sessionLoadFailureFromThunder({ }));
629629
else {
630630
auto responseData = responseMessage->extractData();
@@ -634,8 +634,10 @@ void CDMInstanceSessionThunder::loadSession(LicenseType, const String& sessionID
634634
}
635635
}
636636
});
637-
if (!m_session || m_sessionID.isEmpty() || opencdm_session_load(m_session->get()))
637+
if (!m_session || m_sessionID.isEmpty() || opencdm_session_load(m_session->get())) {
638+
GST_DEBUG("loading failed");
638639
sessionFailure();
640+
}
639641
}
640642

641643
void CDMInstanceSessionThunder::closeSession(const String& sessionID, CloseSessionCallback&& callback)

0 commit comments

Comments
 (0)