PulseAudio: Add a null pointer check for safety.

Public issue https://github.com/mackron/miniaudio/issues/527
This commit is contained in:
David Reid
2022-08-29 09:57:35 +10:00
parent 93e1755e37
commit ef737641de
+16
View File
@@ -28331,6 +28331,14 @@ static void ma_device_sink_info_callback(ma_pa_context* pPulseContext, const ma_
return;
}
/*
There has been a report that indicates that pInfo can be null which results
in a null pointer dereference below. We'll check for this for safety.
*/
if (pInfo == NULL) {
return;
}
pInfoOut = (ma_pa_sink_info*)pUserData;
MA_ASSERT(pInfoOut != NULL);
@@ -28347,6 +28355,14 @@ static void ma_device_source_info_callback(ma_pa_context* pPulseContext, const m
return;
}
/*
There has been a report that indicates that pInfo can be null which results
in a null pointer dereference below. We'll check for this for safety.
*/
if (pInfo == NULL) {
return;
}
pInfoOut = (ma_pa_source_info*)pUserData;
MA_ASSERT(pInfoOut != NULL);