Skip to content

Commit 66d0f75

Browse files
committed
fix memory corruption caused by pre-loading
1 parent 02a042b commit 66d0f75

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ports/espressif/common-hal/audiobusio/__init__.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ void port_i2s_play(i2s_t *self, mp_obj_t sample, bool loop) {
184184
self->next_buffer_size = sizeof(starting_frame);
185185
i2s_fill_buffer(self);
186186
i2s_channel_preload_data(self->handle, &starting_frame, sizeof(uint32_t), &bytes_loaded);
187-
preloaded += 1;
187+
preloaded += bytes_loaded;
188188
}
189189

190190
// enable the channel

0 commit comments

Comments
 (0)