andrewrk / libsoundio

C library for cross-platform real-time audio input and output
http://libsound.io/
MIT License
1.94k stars 230 forks source link

Fix invalid memory access in soundio_sort_channel_layouts() #192

Closed cgutman closed 6 years ago

cgutman commented 6 years ago

The parameters to qsort()'s comparator is a pointer to the items being sorted, not a pointer to a pointer to the items being sorted. As a result of this bug, soundio_sort_channel_layouts() doesn't correctly sort layouts and accesses out-of-bounds memory addresses that may cause a crash.

andrewrk commented 6 years ago

Thanks!