src/audio/SDL_audiocvt.c
changeset 2880 3c2f56e433a8
parent 2879 3ff86c46d324
child 2881 c8d203ef4335
equal deleted inserted replaced
2879:3ff86c46d324 2880:3c2f56e433a8
  1680         for( i = 0; i <= m; ++i ) { \
  1680         for( i = 0; i <= m; ++i ) { \
  1681             dst[i] = fix(fSinc[i] * norm_fact); \
  1681             dst[i] = fix(fSinc[i] * norm_fact); \
  1682         } \
  1682         } \
  1683     }
  1683     }
  1684 
  1684 
       
  1685     /* !!! FIXME: this memory leaks. */
       
  1686     cvt->coeff = (Uint8 *) SDL_malloc((SDL_AUDIO_BITSIZE(format) / 8) * m);
       
  1687     if (cvt->coeff == NULL) {
       
  1688         return -1;
       
  1689     }
       
  1690 
  1685     /* If we're using floating point, we only need to normalize */
  1691     /* If we're using floating point, we only need to normalize */
  1686     if (SDL_AUDIO_ISFLOAT(format) && SDL_AUDIO_BITSIZE(format) == 32) {
  1692     if (SDL_AUDIO_ISFLOAT(format) && SDL_AUDIO_BITSIZE(format) == 32) {
  1687         float *fDest = (float *) cvt->coeff;
  1693         float *fDest = (float *) cvt->coeff;
  1688         for (i = 0; i <= m; ++i) {
  1694         for (i = 0; i <= m; ++i) {
  1689             fDest[i] = fSinc[i] * norm_fact;
  1695             fDest[i] = fSinc[i] * norm_fact;