btstack_resample: prevent out of bound read

This commit is contained in:
Matthias Ringwald 2024-12-05 14:01:47 +01:00
parent e9d8dc8bd8
commit 0532fef7b5

View File

@ -79,6 +79,7 @@ uint16_t btstack_resample_block(btstack_resample_t * context, const int16_t * in
int i;
if (src_pos >= (num_frames - 1u)){
// store last sample
index = (num_frames-1u) * context->num_channels;
for (i=0;i<context->num_channels;i++){
context->last_sample[i] = input_buffer[index++];
}