From 02dde638f58bcb35d7c74259b745e096df493a6e Mon Sep 17 00:00:00 2001 From: Mike Jerris Date: Thu, 22 Oct 2015 12:59:33 -0500 Subject: [PATCH] FS-8378: [mod_esf] fix crash when using esf_page over loopback when transcoding --- src/mod/applications/mod_esf/mod_esf.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/mod/applications/mod_esf/mod_esf.c b/src/mod/applications/mod_esf/mod_esf.c index 82e50c21c0..51a2551272 100644 --- a/src/mod/applications/mod_esf/mod_esf.c +++ b/src/mod/applications/mod_esf/mod_esf.c @@ -473,7 +473,10 @@ SWITCH_STANDARD_APP(bcast_function) read_impl.actual_samples_per_second, ebuf, &encoded_datalen, &rate, &flag); - read_frame->data = encoded_data; + if (read_frame->buflen >= encoded_datalen) { + memcpy(read_frame->data, encoded_data, encoded_datalen); + } + read_frame->datalen = encoded_datalen; } else {