From 359c0cbcaa758b6821c85ae9fc89354a2795ac95 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Tue, 15 Sep 2015 22:19:12 -0500 Subject: [PATCH] FS-8169 #resolve [uuid_displace on stereo channels can lead to memory corruption causing a crash] --- src/switch_ivr_async.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/switch_ivr_async.c b/src/switch_ivr_async.c index 0438930299..9f5b472b19 100644 --- a/src/switch_ivr_async.c +++ b/src/switch_ivr_async.c @@ -770,7 +770,7 @@ static switch_bool_t write_displace_callback(switch_media_bug_t *bug, void *user } else { st = switch_core_file_read(&dh->fh, rframe->data, &len); if (len < rframe->samples) { - memset((char *)rframe->data + len * 2 * dh->fh.channels, 0, (rframe->datalen - len) * 2 * dh->fh.channels); + memset((char *)rframe->data + (len * 2 * dh->fh.channels), 0, (rframe->samples - len) * 2 * dh->fh.channels); } }