Skip to content

Commit

Permalink
fix: Fixed possible racing condition in libsamplerate
Browse files Browse the repository at this point in the history
  • Loading branch information
timschneeb committed Jul 22, 2023
1 parent dc9cd69 commit 3c8df2c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions app/src/main/cpp/libjdspimptoolbox/libsamplerate/src_sinc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit 3c8df2c

Please sign in to comment.