mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-10-29 05:40:23 -04:00
bluetooth: Do not attempt decoding too short faststream packet data
Looks like sbc_decode() would seldom access more than specified input length bytes from input buffer if input length is less than expected frame size. Fix potential access past allocated memory by checking if input contains complete frame before calling sbc_decode() Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/781>
This commit is contained in:
parent
5cefef591e
commit
5830e03036
1 changed files with 5 additions and 0 deletions
|
|
@ -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),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue