# HG changeset patch # User Ryan C. Gordon # Date 1229675426 0 # Node ID 3c2f56e433a8794b72cf4be38be450f69d6e416f # Parent 3ff86c46d3240b191f51bdee844cf2773b664491 Allocate SDL_AudioCVT::coeff before using it. FIXME: this is a memory leak. We don't have an SDL_FreeAudioCVT() yet. diff -r 3ff86c46d324 -r 3c2f56e433a8 src/audio/SDL_audiocvt.c --- a/src/audio/SDL_audiocvt.c Fri Dec 19 06:43:41 2008 +0000 +++ b/src/audio/SDL_audiocvt.c Fri Dec 19 08:30:26 2008 +0000 @@ -1682,6 +1682,12 @@ } \ } + /* !!! FIXME: this memory leaks. */ + cvt->coeff = (Uint8 *) SDL_malloc((SDL_AUDIO_BITSIZE(format) / 8) * m); + if (cvt->coeff == NULL) { + return -1; + } + /* If we're using floating point, we only need to normalize */ if (SDL_AUDIO_ISFLOAT(format) && SDL_AUDIO_BITSIZE(format) == 32) { float *fDest = (float *) cvt->coeff;