mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-22 15:17:29 +09:00
[dom media] Avoid a potential issue when assigning a media data buffer.
This commit is contained in:
parent
9b6c2f36f1
commit
9eaee03eb4
1 changed files with 10 additions and 2 deletions
|
|
@ -106,8 +106,16 @@ public:
|
||||||
|
|
||||||
AlignedBuffer& operator=(AlignedBuffer&& aOther)
|
AlignedBuffer& operator=(AlignedBuffer&& aOther)
|
||||||
{
|
{
|
||||||
this->~AlignedBuffer();
|
if (&aOther == this) {
|
||||||
new (this) AlignedBuffer(Move(aOther));
|
return *this;
|
||||||
|
}
|
||||||
|
mData = aOther.mData;
|
||||||
|
mLength = aOther.mLength;
|
||||||
|
mBuffer = Move(aOther.mBuffer);
|
||||||
|
mCapacity = aOther.mCapacity;
|
||||||
|
aOther.mData = nullptr;
|
||||||
|
aOther.mLength = 0;
|
||||||
|
aOther.mCapacity = 0;
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue