summaryrefslogtreecommitdiffstats
path: root/dom/media/eme/MediaEncryptedEvent.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'dom/media/eme/MediaEncryptedEvent.cpp')
-rw-r--r--dom/media/eme/MediaEncryptedEvent.cpp8
1 files changed, 4 insertions, 4 deletions
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<uint8_t> 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;