aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorMatthew Gregan <[email protected]>2022-09-21 19:27:36 +1200
committerGitHub <[email protected]>2022-09-21 19:27:36 +1200
commit28c8aa4a9c3568187e16e3a47a0d16371d1c5d33 (patch)
tree8a6216b76bc8dc5aad1e8fac2ef0dc5df821062d
parent06aa271e5bca1a74692c8828ad8585dd9598e092 (diff)
downloadcubeb-28c8aa4a9c3568187e16e3a47a0d16371d1c5d33.tar.gz
cubeb-28c8aa4a9c3568187e16e3a47a0d16371d1c5d33.zip
Null check `context` in cubeb_enumerate_devices.
-rw-r--r--src/cubeb.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cubeb.c b/src/cubeb.c
index b3d32ee..7f14bfa 100644
--- a/src/cubeb.c
+++ b/src/cubeb.c
@@ -632,7 +632,7 @@ cubeb_enumerate_devices(cubeb * context, cubeb_device_type devtype,
int rv;
if ((devtype & (CUBEB_DEVICE_TYPE_INPUT | CUBEB_DEVICE_TYPE_OUTPUT)) == 0)
return CUBEB_ERROR_INVALID_PARAMETER;
- if (collection == NULL)
+ if (context == NULL || collection == NULL)
return CUBEB_ERROR_INVALID_PARAMETER;
if (!context->ops->enumerate_devices)
return CUBEB_ERROR_NOT_SUPPORTED;