diff --git a/starboard/shared/win32/dx_context_video_decoder.cc b/starboard/shared/win32/dx_context_video_decoder.cc index 1ca74038cb85..b576659c87bb 100644 --- a/starboard/shared/win32/dx_context_video_decoder.cc +++ b/starboard/shared/win32/dx_context_video_decoder.cc @@ -45,7 +45,7 @@ HardwareDecoderContext GetDirectXForHardwareDecoding() { query_display(display, EGL_DEVICE_EXT, &egl_device); SB_DCHECK(egl_device != 0); - intptr_t device; + intptr_t device = 0; query_device(reinterpret_cast(egl_device), EGL_D3D11_DEVICE_ANGLE, &device); diff --git a/starboard/shared/win32/video_decoder.cc b/starboard/shared/win32/video_decoder.cc index b69cdaf5bb1c..f8890195d88b 100644 --- a/starboard/shared/win32/video_decoder.cc +++ b/starboard/shared/win32/video_decoder.cc @@ -194,6 +194,10 @@ VideoDecoder::VideoDecoder( HardwareDecoderContext hardware_context = GetDirectXForHardwareDecoding(); d3d_device_ = hardware_context.dx_device_out; device_manager_ = hardware_context.dxgi_device_manager_out; + if (!d3d_device_ || !device_manager_) { + return; + } + HRESULT hr = d3d_device_.As(&video_device_); if (FAILED(hr)) { return;