mirror of
https://github.com/yawut/SDL.git
synced 2026-06-19 15:09:37 -05:00
Allocate SDL_AudioCVT::coeff before using it.
FIXME: this is a memory leak. We don't have an SDL_FreeAudioCVT() yet.
This commit is contained in:
parent
809690101a
commit
29777ee64b
|
|
@ -1682,6 +1682,12 @@ SDL_BuildWindowedSinc(SDL_AudioCVT * cvt, SDL_AudioFormat format,
|
|||
} \
|
||||
}
|
||||
|
||||
/* !!! 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;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user