1
0
mirror of https://github.com/signalwire/freeswitch.git synced 2025-03-04 17:51:03 +00:00

FS-7465: make sure write buffer is big enough on stereo file handles

This commit is contained in:
Michael Jerris 2015-04-24 09:47:16 -05:00 committed by Brian
parent d3a747ad02
commit dbc124d45e

@ -412,7 +412,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_file_write(switch_file_handle_t *fh,
switch_resample_process(fh->resampler, data, (uint32_t) * len); switch_resample_process(fh->resampler, data, (uint32_t) * len);
if (fh->resampler->to_len > orig_len) { if (fh->resampler->to_len > orig_len) {
if (!fh->dbuf) { if (!fh->dbuf || (fh->dbuflen < fh->resampler->to_len * 2 * fh->channels)) {
void *mem; void *mem;
fh->dbuflen = fh->resampler->to_len * 2 * fh->channels; fh->dbuflen = fh->resampler->to_len * 2 * fh->channels;
mem = realloc(fh->dbuf, fh->dbuflen); mem = realloc(fh->dbuf, fh->dbuflen);