Add code to check divisions and mods for a potrntial divide by zero problem. MAy cause SPS to terminate but leave a log message.

This commit is contained in:
Mike Brady
2021-11-21 21:47:32 +00:00
parent 881a5ca25e
commit 14bfba2724
10 changed files with 208 additions and 131 deletions
+2
View File
@@ -22,6 +22,8 @@ static void write_callback(struct SoundIoOutStream *outstream, int frame_count_m
char *read_ptr = soundio_ring_buffer_read_ptr(ring_buffer);
int fill_bytes = soundio_ring_buffer_fill_count(ring_buffer);
if (outstream->bytes_per_frame == 0)
die("soundio: outstream->bytes_per_frame is zero.");
int fill_count = fill_bytes / outstream->bytes_per_frame;
debug(3,