From 5ae35e27228f84931293b81a7d8baeb24bd44602 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Wed, 3 Oct 2018 19:01:59 -0700 Subject: [PATCH] Fix invalid memory access in soundio_sort_channel_layouts() --- src/soundio.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/soundio.c b/src/soundio.c index 2486888..116ef50 100644 --- a/src/soundio.c +++ b/src/soundio.c @@ -733,8 +733,8 @@ const struct SoundIoChannelLayout *soundio_best_matching_channel_layout( } static int compare_layouts(const void *a, const void *b) { - const struct SoundIoChannelLayout *layout_a = *((struct SoundIoChannelLayout **)a); - const struct SoundIoChannelLayout *layout_b = *((struct SoundIoChannelLayout **)b); + const struct SoundIoChannelLayout *layout_a = (const struct SoundIoChannelLayout *)a; + const struct SoundIoChannelLayout *layout_b = (const struct SoundIoChannelLayout *)b; if (layout_a->channel_count > layout_b->channel_count) return -1; else if (layout_a->channel_count < layout_b->channel_count)