mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-31 11:37:30 +09:00
Ensure we AddRef prior to early return in MediaType::Assign.
This commit is contained in:
parent
254714d53b
commit
dfb01e0384
1 changed files with 4 additions and 4 deletions
|
|
@ -82,7 +82,10 @@ MediaType::Assign(const AM_MEDIA_TYPE* aMediaType)
|
||||||
Clear();
|
Clear();
|
||||||
|
|
||||||
// Shallow copy.
|
// Shallow copy.
|
||||||
memcpy(this, aMediaType, sizeof(AM_MEDIA_TYPE));
|
memcpy(static_cast<AM_MEDIA_TYPE*>(this), aMediaType, sizeof(AM_MEDIA_TYPE));
|
||||||
|
|
||||||
|
if (pUnk)
|
||||||
|
pUnk->AddRef();
|
||||||
|
|
||||||
// Create deep copy of incoming data...
|
// Create deep copy of incoming data...
|
||||||
if (cbFormat) {
|
if (cbFormat) {
|
||||||
|
|
@ -92,9 +95,6 @@ MediaType::Assign(const AM_MEDIA_TYPE* aMediaType)
|
||||||
memcpy(pbFormat, aMediaType->pbFormat, cbFormat);
|
memcpy(pbFormat, aMediaType->pbFormat, cbFormat);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pUnk)
|
|
||||||
pUnk->AddRef();
|
|
||||||
|
|
||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue