summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/modules/bluetooth/a2dp-codec-sbc.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/modules/bluetooth/a2dp-codec-sbc.c b/src/modules/bluetooth/a2dp-codec-sbc.c
index 5476697f8..1306c79f2 100644
--- a/src/modules/bluetooth/a2dp-codec-sbc.c
+++ b/src/modules/bluetooth/a2dp-codec-sbc.c
@@ -1331,6 +1331,11 @@ static size_t decode_buffer_faststream(void *codec_info, const uint8_t *input_bu
continue;
}
+ if (to_decode < sbc_info->frame_length) {
+ pa_log_debug("FastStream SBC input %lu is too short (expected frame length %lu)", to_decode, sbc_info->frame_length);
+ break;
+ }
+
decoded = sbc_decode(&sbc_info->sbc,
p, to_decode,
decode_buffer, sizeof(decode_buffer),