aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--src/cubeb_wasapi.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/cubeb_wasapi.cpp b/src/cubeb_wasapi.cpp
index ae06097..5aea0a5 100644
--- a/src/cubeb_wasapi.cpp
+++ b/src/cubeb_wasapi.cpp
@@ -2087,7 +2087,9 @@ int setup_wasapi_stream_one_side(cubeb_stream * stm,
if (rv == CUBEB_OK) {
const char* HANDSFREE_TAG = "BTHHFENUM";
size_t len = sizeof(HANDSFREE_TAG);
- if (direction == eCapture && strncmp(device_info.group_id, HANDSFREE_TAG, len) == 0) {
+ if (direction == eCapture &&
+ strlen(device_info.group_id) >= len &&
+ strncmp(device_info.group_id, HANDSFREE_TAG, len) == 0) {
// Rather high-latency to prevent constant under-runs in this particular
// case of an input device using bluetooth handsfree.
uint32_t default_period_frames = hns_to_frames(device_info.default_rate, default_period);