Fix crash on CopyRects failure

This commit is contained in:
Luke Usher 2019-09-09 22:12:46 +01:00
parent 421864c0bb
commit 614e7e4b9f
1 changed files with 8 additions and 0 deletions

View File

@ -4737,6 +4737,14 @@ VOID WINAPI XTL::EMUPATCH(D3DDevice_CopyRects)
D3DSURFACE_DESC SourceDesc, DestinationDesc;
auto pHostSourceSurface = GetHostSurface(pSourceSurface);
auto pHostDestSurface = GetHostSurface(pDestinationSurface);
if (pHostSourceSurface == nullptr || pHostDestSurface == nullptr) {
// Test Case: DOA2 attempts to copy from an index buffer resource type
// TODO: What should we do here?
LOG_TEST_CASE("D3DDevice-CopyRects: Failed to fetch host surfaces");
return;
}
pHostSourceSurface->GetDesc(&SourceDesc);
pHostDestSurface->GetDesc(&DestinationDesc);