From 78c8a5ffba6267f50e7c3353afa57c0a9c5d11e6 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 87cfba30fa..d295ca4ae0 100644 --- a/src/mod/applications/mod_esf/mod_esf.c +++ b/src/mod/applications/mod_esf/mod_esf.c @@ -475,7 +475,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 {