Commit cdb7bed1 authored by David Reid's avatar David Reid

Fix a null pointer dereference.

parent d0b82d3c
...@@ -10531,7 +10531,7 @@ BOOL CALLBACK ma_context_get_device_info_callback__dsound(LPGUID lpGuid, LPCSTR ...@@ -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;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment