From ef7472b3ac8b6f79b20c9aed392f0132312e68fe Mon Sep 17 00:00:00 2001 From: Aaron Culliney Date: Mon, 7 Sep 2015 11:05:22 -0700 Subject: [PATCH] Fix invalid assert ... system_buffer_size can be modified lower --- src/audio/speaker.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/audio/speaker.c b/src/audio/speaker.c index 6fe86c06..10cba62f 100644 --- a/src/audio/speaker.c +++ b/src/audio/speaker.c @@ -231,7 +231,9 @@ static void _submit_samples_buffer_fullspeed(void) { if (speakerBuffer->Lock(speakerBuffer, num_samples_pad*sizeof(int16_t), &system_samples_buffer, &system_buffer_size)) { return; } - assert(num_samples_pad <= system_buffer_size); + if (num_samples_pad > system_buffer_size/sizeof(int16_t)) { + num_samples_pad = system_buffer_size/sizeof(int16_t); + } //SPEAKER_LOG("bytes_queued:%d enqueueing %d quiet samples", bytes_queued, num_samples_pad); for (unsigned int i=0; i