mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-03-20 15:51:07 +01:00
Fixed analyze warnings in SDL_render_d3d12.c
warning C6011: Dereferencing NULL pointer 'data->swapChain'. warning C6011: Dereferencing NULL pointer 'data->debugInterface'.
This commit is contained in:
@@ -795,8 +795,9 @@ static HRESULT D3D12_CreateDeviceResources(SDL_Renderer *renderer)
|
||||
result = E_FAIL;
|
||||
goto done;
|
||||
}
|
||||
D3D12GetDebugInterfaceFunc(D3D_GUID(SDL_IID_ID3D12Debug), (void **)&data->debugInterface);
|
||||
D3D_CALL(data->debugInterface, EnableDebugLayer);
|
||||
if (SUCCEEDED(D3D12GetDebugInterfaceFunc(D3D_GUID(SDL_IID_ID3D12Debug), (void **)&data->debugInterface))) {
|
||||
D3D_CALL(data->debugInterface, EnableDebugLayer);
|
||||
}
|
||||
}
|
||||
#endif /*!defined(__XBOXONE__) && !defined(__XBOXSERIES__)*/
|
||||
|
||||
@@ -1302,7 +1303,7 @@ static HRESULT D3D12_CreateWindowSizeDependentResources(SDL_Renderer *renderer)
|
||||
}
|
||||
} else {
|
||||
result = D3D12_CreateSwapChain(renderer, w, h);
|
||||
if (FAILED(result)) {
|
||||
if (FAILED(result) || !data->swapChain) {
|
||||
goto done;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user