summaryrefslogtreecommitdiff
path: root/dom/media/MediaData.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'dom/media/MediaData.cpp')
-rw-r--r--dom/media/MediaData.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/dom/media/MediaData.cpp b/dom/media/MediaData.cpp
index 4852ea486b..c113b62fe6 100644
--- a/dom/media/MediaData.cpp
+++ b/dom/media/MediaData.cpp
@@ -340,6 +340,15 @@ MediaRawData::MediaRawData(const uint8_t* aData, size_t aSize)
{
}
+MediaRawData::MediaRawData(const uint8_t* aData, size_t aSize,
+ const uint8_t* aAlphaData, size_t aAlphaSize)
+ : MediaData(RAW_DATA, 0)
+ , mCrypto(mCryptoInternal)
+ , mBuffer(aData, aSize)
+ , mAlphaBuffer(aAlphaData, aAlphaSize)
+{
+}
+
already_AddRefed<MediaRawData>
MediaRawData::Clone() const
{
@@ -356,6 +365,9 @@ MediaRawData::Clone() const
if (!s->mBuffer.Append(mBuffer.Data(), mBuffer.Length())) {
return nullptr;
}
+ if (!s->mAlphaBuffer.Append(mAlphaBuffer.Data(), mAlphaBuffer.Length())) {
+ return nullptr;
+ }
return s.forget();
}