SPU2: fix nullptr crash on DSound

This commit is contained in:
Gauvain 'GovanifY' Roussel-Tarbouriech 2020-09-27 04:33:38 +02:00 committed by refractionpcsx2
parent 444f5ed515
commit c8abed371b
1 changed files with 2 additions and 1 deletions

View File

@ -417,7 +417,6 @@ public:
MessageBox((HWND)parent, L"Error Opening the config dialog.", L"OMG ERROR!", MB_OK | MB_SETFOREGROUND);
return;
}
}
s32 Test() const
@ -428,6 +427,8 @@ public:
int GetEmptySampleCount()
{
DWORD play, write;
if (buffer == nullptr)
return 0;
buffer->GetCurrentPosition(&play, &write);
// Note: Dsound's write cursor is bogus. Use our own instead: