From 54b4fb0be65011d4ba706144a2a508a3a74796ac Mon Sep 17 00:00:00 2001 From: Moonchild Date: Wed, 3 Jun 2020 09:44:20 +0000 Subject: Bug 1632717 --- dom/media/eme/MediaEncryptedEvent.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'dom/media/eme/MediaEncryptedEvent.cpp') diff --git a/dom/media/eme/MediaEncryptedEvent.cpp b/dom/media/eme/MediaEncryptedEvent.cpp index 8e2595fcb..fe1c8a3bc 100644 --- a/dom/media/eme/MediaEncryptedEvent.cpp +++ b/dom/media/eme/MediaEncryptedEvent.cpp @@ -87,10 +87,10 @@ MediaEncryptedEvent::Constructor(const GlobalObject& aGlobal, e->mInitDataType = aEventInitDict.mInitDataType; if (!aEventInitDict.mInitData.IsNull()) { const auto& a = aEventInitDict.mInitData.Value(); - a.ComputeLengthAndData(); - e->mInitData = ArrayBuffer::Create(aGlobal.Context(), - a.Length(), - a.Data()); + nsTArray initData; + CopyArrayBufferViewOrArrayBufferData(a, initData); + e->mInitData = ArrayBuffer::Create(aGlobal.Context(), initData.Length(), + initData.Elements()); if (!e->mInitData) { aRv.Throw(NS_ERROR_OUT_OF_MEMORY); return nullptr; -- cgit v1.2.3