mirror of
https://github.com/rhasspy/espeak-ng.git
synced 2026-11-27 05:23:28 +00:00
Fix the realloc usage of outbuffer in WaveCallback(wavegen.c)
This commit is contained in:
@@ -380,10 +380,11 @@ static int WaveCallback(const void *inputBuffer, void *outputBuffer,
|
|||||||
// make a buffer 3x size of the portaudio output
|
// make a buffer 3x size of the portaudio output
|
||||||
ix = pa_size*3;
|
ix = pa_size*3;
|
||||||
if (ix > outbuffer_size) {
|
if (ix > outbuffer_size) {
|
||||||
outbuffer = (unsigned char *)realloc(outbuffer, ix);
|
unsigned char *new_outbuffer = (unsigned char *)realloc(outbuffer, ix);
|
||||||
if (outbuffer == NULL) {
|
if (new_outbuffer == NULL)
|
||||||
fprintf(stderr, "espeak: out of memory\n");
|
fprintf(stderr, "espeak: out of memory\n");
|
||||||
}
|
else
|
||||||
|
outbuffer = new_outbuffer;
|
||||||
outbuffer_size = ix;
|
outbuffer_size = ix;
|
||||||
out_ptr = NULL;
|
out_ptr = NULL;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user