mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-29 13:20:54 +00:00
Verify that DXGI optional pointers exist before wrapping. Refs #652
* For example in ::GetFullscreenState() the target pointer itself can be NULL as well as the pointed-to-pointer being NULL.
This commit is contained in:
@@ -359,7 +359,7 @@ HRESULT STDMETHODCALLTYPE WrappedIDXGISwapChain4::GetContainingOutput(IDXGIOutpu
|
||||
{
|
||||
HRESULT ret = m_pReal->GetContainingOutput(ppOutput);
|
||||
|
||||
if(SUCCEEDED(ret) && *ppOutput)
|
||||
if(SUCCEEDED(ret) && ppOutput && *ppOutput)
|
||||
*ppOutput = (IDXGIOutput *)(new WrappedIDXGIOutput5(this, *ppOutput));
|
||||
|
||||
return ret;
|
||||
@@ -408,7 +408,7 @@ HRESULT WrappedIDXGISwapChain4::GetFullscreenState(
|
||||
{
|
||||
HRESULT ret = m_pReal->GetFullscreenState(pFullscreen, ppTarget);
|
||||
|
||||
if(SUCCEEDED(ret) && *ppTarget)
|
||||
if(SUCCEEDED(ret) && ppTarget && *ppTarget)
|
||||
*ppTarget = (IDXGIOutput *)(new WrappedIDXGIOutput5(this, *ppTarget));
|
||||
|
||||
return ret;
|
||||
@@ -554,7 +554,7 @@ HRESULT STDMETHODCALLTYPE WrappedIDXGISwapChain4::GetRestrictToOutput(IDXGIOutpu
|
||||
{
|
||||
HRESULT ret = m_pReal2->GetRestrictToOutput(ppRestrictToOutput);
|
||||
|
||||
if(SUCCEEDED(ret) && *ppRestrictToOutput)
|
||||
if(SUCCEEDED(ret) && ppRestrictToOutput && *ppRestrictToOutput)
|
||||
*ppRestrictToOutput = (IDXGIOutput *)(new WrappedIDXGIOutput5(this, *ppRestrictToOutput));
|
||||
|
||||
return ret;
|
||||
|
||||
@@ -1056,7 +1056,7 @@ public:
|
||||
{
|
||||
HRESULT ret = m_pReal->EnumOutputs(Output, ppOutput);
|
||||
|
||||
if(SUCCEEDED(ret))
|
||||
if(SUCCEEDED(ret) && ppOutput && *ppOutput)
|
||||
*ppOutput = (IDXGIOutput *)(new WrappedIDXGIOutput5(this, *ppOutput));
|
||||
|
||||
return ret;
|
||||
|
||||
Reference in New Issue
Block a user