From 0a4bbaf5a55520da82968cc4bdb7a3d86a165620 Mon Sep 17 00:00:00 2001 From: Travis Cross Date: Wed, 3 Jul 2013 15:58:46 +0000 Subject: [PATCH] Fix uninitialized use of length variable Bad things must have been happening when this was hit. This was introduced in commit 7656a075c750f63d4095f6ed9b558c6f18443698 --- src/switch_ivr_async.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/switch_ivr_async.c b/src/switch_ivr_async.c index 9caa164852..0be6c07d59 100644 --- a/src/switch_ivr_async.c +++ b/src/switch_ivr_async.c @@ -1202,6 +1202,9 @@ static switch_bool_t record_callback(switch_media_bug_t *bug, void *user_data, s switch_time_t diff; rh->wready = 1; + nframe = switch_core_media_bug_get_native_write_frame(bug); + len = nframe->datalen; + if (!rh->rready) { unsigned char fill_data[SWITCH_RECOMMENDED_BUFFER_SIZE] = {0}; switch_size_t fill_len = len; @@ -1210,8 +1213,6 @@ static switch_bool_t record_callback(switch_media_bug_t *bug, void *user_data, s } - nframe = switch_core_media_bug_get_native_write_frame(bug); - len = nframe->datalen; if (rh->last_write_time && rh->last_write_time < now) {