From 3c8df2ca6802554ad69c4ae135ffe0844125a675 Mon Sep 17 00:00:00 2001 From: Tim Schneeberger Date: Sat, 22 Jul 2023 03:42:25 +0200 Subject: [PATCH] fix: Fixed possible racing condition in libsamplerate --- .../main/cpp/libjdspimptoolbox/libsamplerate/src_sinc.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/src/main/cpp/libjdspimptoolbox/libsamplerate/src_sinc.c b/app/src/main/cpp/libjdspimptoolbox/libsamplerate/src_sinc.c index 44e9fd4ea..9ff9092f1 100755 --- a/app/src/main/cpp/libjdspimptoolbox/libsamplerate/src_sinc.c +++ b/app/src/main/cpp/libjdspimptoolbox/libsamplerate/src_sinc.c @@ -108,6 +108,10 @@ sinc_set_converter (SRC_PRIVATE *psrc, int src_enum) temp_filter.sinc_magic_marker = SINC_MAGIC_MARKER ; temp_filter.channels = psrc->channels ; + temp_filter.coeffs = decompressedCoefficients; + temp_filter.coeff_half_len = 22438 - 2; + temp_filter.index_inc = 491; + if (psrc->channels > ARRAY_LEN (temp_filter.left_calc)) return SRC_ERR_BAD_CHANNEL_COUNT ; else if (psrc->channels == 1) @@ -135,10 +139,6 @@ sinc_set_converter (SRC_PRIVATE *psrc, int src_enum) } ; psrc->reset = sinc_reset ; - temp_filter.coeffs = decompressedCoefficients; - temp_filter.coeff_half_len = 22438 - 2; - temp_filter.index_inc = 491; - /* ** FIXME : This needs to be looked at more closely to see if there is ** a better way. Need to look at prepare_data () at the same time.