]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
fix seg when piggybacking mono files with stereo in file stream
authorAnthony Minessale <anthm@freeswitch.org>
Fri, 15 Mar 2013 20:09:58 +0000 (15:09 -0500)
committerAnthony Minessale <anthm@freeswitch.org>
Sat, 16 Mar 2013 01:34:24 +0000 (20:34 -0500)
src/mod/applications/mod_dptools/mod_dptools.c

index 3f6bc9339b6c8f328b020852318596cb84c50e0d..bd1a82fc80adbba07ff1c0930f9e8e2999bfa4fc 100755 (executable)
@@ -4508,6 +4508,12 @@ static switch_status_t next_file(switch_file_handle_t *handle)
                goto top;
        }
 
+       if (handle->dbuflen) {
+               free(handle->dbuf);
+               handle->dbuflen = 0;
+               handle->dbuf = NULL;
+       }
+
        handle->samples = context->fh.samples;
        //handle->samplerate = context->fh.samplerate;
        //handle->channels = context->fh.channels;
@@ -4564,6 +4570,7 @@ static switch_status_t file_string_file_open(switch_file_handle_t *handle, const
        context->index = -1;
 
        handle->private_info = context;
+       handle->pre_buffer_datalen = 0;
 
        return next_file(handle);
 }