aboutsummaryrefslogtreecommitdiff
path: root/regression-fixes/1-resampler_unsigned_fix.patch
blob: 99a4c8a6d3795e9141973a037df5d2e9004a8975 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
diff --git a/libspeex/resample.c b/libspeex/resample.c
index 4403f78..48ffcef 100644
--- a/libspeex/resample.c
+++ b/libspeex/resample.c
@@ -561,10 +561,10 @@ static void update_filter(SpeexResamplerState *st)
       }
       for (i=0;i<st->den_rate;i++)
       {
-         spx_uint32_t j;
+         spx_int32_t j;
          for (j=0;j<st->filt_len;j++)
          {
-            st->sinc_table[i*st->filt_len+j] = sinc(st->cutoff,((j-st->filt_len/2+1)-((float)i)/st->den_rate), st->filt_len, quality_map[st->quality].window_func);
+            st->sinc_table[i*st->filt_len+j] = sinc(st->cutoff,((j-(spx_int32_t)st->filt_len/2+1)-((float)i)/st->den_rate), st->filt_len, quality_map[st->quality].window_func);
          }
       }
 #ifdef FIXED_POINT