mirror of
https://github.com/mackron/miniaudio.git
synced 2026-04-24 01:04:02 +02:00
Fix a null pointer dereference.
This commit is contained in:
+1
-1
@@ -10531,7 +10531,7 @@ BOOL CALLBACK ma_context_get_device_info_callback__dsound(LPGUID lpGuid, LPCSTR
|
|||||||
return FALSE; /* Stop enumeration. */
|
return FALSE; /* Stop enumeration. */
|
||||||
} else {
|
} else {
|
||||||
/* Not the default device. */
|
/* Not the default device. */
|
||||||
if (lpGuid != NULL) {
|
if (lpGuid != NULL && pData->pDeviceID != NULL) {
|
||||||
if (memcmp(pData->pDeviceID->dsound, lpGuid, sizeof(pData->pDeviceID->dsound)) == 0) {
|
if (memcmp(pData->pDeviceID->dsound, lpGuid, sizeof(pData->pDeviceID->dsound)) == 0) {
|
||||||
ma_strncpy_s(pData->pDeviceInfo->name, sizeof(pData->pDeviceInfo->name), lpcstrDescription, (size_t)-1);
|
ma_strncpy_s(pData->pDeviceInfo->name, sizeof(pData->pDeviceInfo->name), lpcstrDescription, (size_t)-1);
|
||||||
pData->found = MA_TRUE;
|
pData->found = MA_TRUE;
|
||||||
|
|||||||
Reference in New Issue
Block a user