summaryrefslogtreecommitdiffstats
path: root/dom/media/MediaData.h
diff options
context:
space:
mode:
Diffstat (limited to 'dom/media/MediaData.h')
-rw-r--r--dom/media/MediaData.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/dom/media/MediaData.h b/dom/media/MediaData.h
index 4040f368ba..6b7e0ff84d 100644
--- a/dom/media/MediaData.h
+++ b/dom/media/MediaData.h
@@ -94,8 +94,16 @@ class AlignedBuffer {
}
AlignedBuffer& operator=(AlignedBuffer&& aOther) {
- this->~AlignedBuffer();
- new (this) AlignedBuffer(std::move(aOther));
+ if (&aOther == this) {
+ return *this;
+ }
+ mData = aOther.mData;
+ mLength = aOther.mLength;
+ mBuffer = std::move(aOther.mBuffer);
+ mCapacity = aOther.mCapacity;
+ aOther.mData = nullptr;
+ aOther.mLength = 0;
+ aOther.mCapacity = 0;
return *this;
}