From cdb7bed14ead11ba646967cb781ed078b13944d7 Mon Sep 17 00:00:00 2001 From: David Reid Date: Thu, 30 Jan 2020 19:14:10 +1000 Subject: [PATCH] Fix a null pointer dereference. --- miniaudio.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/miniaudio.h b/miniaudio.h index ee5a6701..fa986ff2 100644 --- a/miniaudio.h +++ b/miniaudio.h @@ -10531,7 +10531,7 @@ BOOL CALLBACK ma_context_get_device_info_callback__dsound(LPGUID lpGuid, LPCSTR return FALSE; /* Stop enumeration. */ } else { /* Not the default device. */ - if (lpGuid != NULL) { + if (lpGuid != NULL && pData->pDeviceID != NULL) { 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); pData->found = MA_TRUE;