Skip to content
This repository was archived by the owner on Oct 25, 2024. It is now read-only.

Commit cbae0dc

Browse files
authored
Fix klocwork issues related to IID_PPV_ARGS (#661)
1 parent 9b43c3a commit cbae0dc

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

talk/owt/sdk/base/win/video_capture_mf.cc

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ void VideoCaptureMF::IncomingFrame(IMFMediaBuffer*& frame, int64_t capture_time)
302302
rtc::scoped_refptr<VideoFrameBuffer> buffer;
303303

304304
HRESULT hr = S_OK;
305-
ID3D11Texture2D* texture = nullptr;
305+
CComPtr<ID3D11Texture2D> texture;
306306
if (manager_) {
307307
CComPtr<IMFDXGIBuffer> dxgi_buffer;
308308
hr = frame->QueryInterface(&dxgi_buffer);
@@ -313,13 +313,14 @@ void VideoCaptureMF::IncomingFrame(IMFMediaBuffer*& frame, int64_t capture_time)
313313
}
314314

315315
// Retrieves the texture from dxgi buffer
316-
if (FAILED(dxgi_buffer->GetResource(IID_PPV_ARGS(&texture))) || texture == nullptr) {
316+
if (FAILED(dxgi_buffer->GetResource(__uuidof(ID3D11Texture2D),
317+
(void**)(&texture)))) {
317318
RTC_LOG(LS_ERROR) << "Retreiving the texture from dxgi buffer failed:"
318319
<< std::system_category().message(hr);
319320
return;
320321
}
321322
surface_handle_->d3d11_device = manager_->GetDevice();
322-
surface_handle_->texture = std::move(texture);
323+
surface_handle_->texture = texture.Detach();
323324
surface_handle_->texture_array_index = 0;
324325
SAFE_RELEASE(frame);
325326
} else {

talk/owt/sdk/base/win/videorendererd3d11.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,8 @@ bool WebrtcVideoRendererD3D11Impl::InitMPO(int width, int height) {
360360
return false;
361361

362362
CComPtr<IDCompositionDesktopDevice> desktop_device;
363-
hr = DCompositionCreateDevice2(dxgi_device2_, IID_PPV_ARGS(&desktop_device));
363+
hr = DCompositionCreateDevice2(dxgi_device2_,
364+
__uuidof(IDCompositionDesktopDevice), (void**)(&desktop_device));
364365
if (FAILED(hr) || !desktop_device.p)
365366
return false;
366367

0 commit comments

Comments
 (0)