Skip to content

Commit 7d0c0ff

Browse files
committed
[EME][GStreamer][Thunder] Fix crash with garbage collected CDMInstance
https://bugs.webkit.org/show_bug.cgi?id=294833 Reviewed by Philippe Normand. There was a crash in certain situations where the CDMInstance got garbage collected, which made it crash as there was no valid object. Now we just bail out and warn. * Source/WebCore/platform/graphics/gstreamer/eme/CDMThunder.cpp: (WebCore::CDMInstanceSessionThunder::requestLicense): Canonical link: https://commits.webkit.org/296608@main
1 parent 26ab43e commit 7d0c0ff

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -496,7 +496,11 @@ void CDMInstanceSessionThunder::requestLicense(LicenseType licenseType, KeyGroup
496496

497497
// FIXME: UUID or system ID?
498498
auto instance = cdmInstanceThunder();
499-
ASSERT(instance);
499+
if (!instance) {
500+
GST_WARNING("no instance, bailing out");
501+
callback(WTFMove(initDataSharedBuffer), { }, false, Failed);
502+
return;
503+
}
500504
m_initData = InitData(instance->keySystem(), WTFMove(initDataSharedBuffer));
501505

502506
GST_TRACE("Going to request a new session id, init data size %zu", m_initData.payload()->size());

0 commit comments

Comments
 (0)