diff options
author | Matthew Gregan <[email protected]> | 2022-09-21 19:27:36 +1200 |
---|---|---|
committer | GitHub <[email protected]> | 2022-09-21 19:27:36 +1200 |
commit | 28c8aa4a9c3568187e16e3a47a0d16371d1c5d33 (patch) | |
tree | 8a6216b76bc8dc5aad1e8fac2ef0dc5df821062d | |
parent | 06aa271e5bca1a74692c8828ad8585dd9598e092 (diff) | |
download | cubeb-28c8aa4a9c3568187e16e3a47a0d16371d1c5d33.tar.gz cubeb-28c8aa4a9c3568187e16e3a47a0d16371d1c5d33.zip |
Null check `context` in cubeb_enumerate_devices.
-rw-r--r-- | src/cubeb.c | 2 |
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; |