Allocate SDL_AudioCVT::coeff before using it.
FIXME: this is a memory leak. We don't have an SDL_FreeAudioCVT() yet. --HG-- extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403342
This commit is contained in:
parent
45ed26c3c2
commit
83de18855b
1 changed files with 6 additions and 0 deletions
|
@ -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 we're using floating point, we only need to normalize */
|
||||||
if (SDL_AUDIO_ISFLOAT(format) && SDL_AUDIO_BITSIZE(format) == 32) {
|
if (SDL_AUDIO_ISFLOAT(format) && SDL_AUDIO_BITSIZE(format) == 32) {
|
||||||
float *fDest = (float *) cvt->coeff;
|
float *fDest = (float *) cvt->coeff;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue