]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
small buffers make big segfaults
authorMichael Jerris <mike@jerris.com>
Thu, 14 Feb 2008 17:12:17 +0000 (17:12 +0000)
committerMichael Jerris <mike@jerris.com>
Thu, 14 Feb 2008 17:12:17 +0000 (17:12 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@7603 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/switch_ivr_async.c
src/switch_ivr_play_say.c

index 60f8ca6d2998fe58d36cf4eb188d58252ad5df2f..07439c8017cfca9ffc7e5d1d503c72d83a60766f 100644 (file)
@@ -165,7 +165,7 @@ static switch_bool_t write_displace_callback(switch_media_bug_t *bug, void *user
                        len = rframe->samples;
 
                        if (dh->mux) {
-                               int16_t buf[1024];
+                               int16_t buf[SWITCH_RECOMMENDED_BUFFER_SIZE / 2];
                                int16_t *fp = rframe->data;
                                uint32_t x;
 
@@ -237,7 +237,7 @@ static switch_bool_t read_displace_callback(switch_media_bug_t *bug, void *user_
                        len = rframe->samples;
 
                        if (dh->mux) {
-                               int16_t buf[1024];
+                               int16_t buf[SWITCH_RECOMMENDED_BUFFER_SIZE / 2];
                                int16_t *fp = rframe->data;
                                uint32_t x;
 
index 93bd1f5cddde36d04464e7af6d3b4d50356e0096..c50d572e9cb773abf8db0e85eb1baf2643c6a547 100644 (file)
@@ -577,7 +577,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_gentones(switch_core_session_t *sessi
        switch_frame_t *read_frame = NULL;
        switch_codec_t *read_codec = NULL, write_codec = { 0 };
        switch_frame_t write_frame = { 0 };
-       switch_byte_t data[1024];
+       switch_byte_t data[SWITCH_RECOMMENDED_BUFFER_SIZE];
        switch_channel_t *channel = switch_core_session_get_channel(session);
 
        switch_channel_pre_answer(channel);