sync w/ libteletone changes from main repo

git-svn-id: http://svn.openzap.org/svn/openzap/trunk@394 a93c3328-9c30-0410-af19-c9cd2b2d52af
This commit is contained in:
Michael Jerris
2008-02-14 18:17:02 +00:00
parent 108bb09a12
commit 509593fc49
3 changed files with 15 additions and 1 deletions

View File

@@ -191,10 +191,13 @@ static int ensure_buffer(teletone_generation_session_t *ts, int need)
need *= ts->channels;
if (need > ts->datalen) {
teletone_audio_t *tmp;
ts->datalen = need + ts->dynamic;
if (!(ts->buffer = realloc(ts->buffer, ts->datalen))) {
tmp = realloc(ts->buffer, ts->datalen);
if (!tmp) {
return -1;
}
ts->buffer = tmp;
}
return 0;