diff options
author | wolfbeast <mcwerewolf@wolfbeast.com> | 2019-05-28 14:41:20 +0200 |
---|---|---|
committer | wolfbeast <mcwerewolf@wolfbeast.com> | 2019-05-28 14:41:20 +0200 |
commit | b3632493a55fa62510a2e5d62e460cbc2cbc51db (patch) | |
tree | b8dea2505fe24ac1c7addfa47311ba1399f421e8 | |
parent | fb1b45e5fcb82e76e303665fbb9d04fb2a800b31 (diff) | |
download | UXP-b3632493a55fa62510a2e5d62e460cbc2cbc51db.tar UXP-b3632493a55fa62510a2e5d62e460cbc2cbc51db.tar.gz UXP-b3632493a55fa62510a2e5d62e460cbc2cbc51db.tar.lz UXP-b3632493a55fa62510a2e5d62e460cbc2cbc51db.tar.xz UXP-b3632493a55fa62510a2e5d62e460cbc2cbc51db.zip |
Ensure we AddRef prior to early return in MediaType::Assign.
-rw-r--r-- | media/webrtc/trunk/webrtc/modules/video_capture/windows/MediaType.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/media/webrtc/trunk/webrtc/modules/video_capture/windows/MediaType.cpp b/media/webrtc/trunk/webrtc/modules/video_capture/windows/MediaType.cpp index 54fc2ab7b..f06709446 100644 --- a/media/webrtc/trunk/webrtc/modules/video_capture/windows/MediaType.cpp +++ b/media/webrtc/trunk/webrtc/modules/video_capture/windows/MediaType.cpp @@ -82,7 +82,10 @@ MediaType::Assign(const AM_MEDIA_TYPE* aMediaType) Clear(); // 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... if (cbFormat) { @@ -92,9 +95,6 @@ MediaType::Assign(const AM_MEDIA_TYPE* aMediaType) memcpy(pbFormat, aMediaType->pbFormat, cbFormat); } - if (pUnk) - pUnk->AddRef(); - return S_OK; } |