Skip to content

Commit 5e3487e

Browse files
[ONEM-41930]: Avoid crashing with null answers during session load
OpenCDM/Thunder can answer with a null message when loading a wrong session.
1 parent 10806d8 commit 5e3487e

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

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)