aboutsummaryrefslogtreecommitdiffstats
path: root/codecs
diff options
context:
space:
mode:
authordvossel <dvossel@f38db490-d61c-443f-a65b-d21fe96a405b>2009-11-06 17:09:01 +0000
committerdvossel <dvossel@f38db490-d61c-443f-a65b-d21fe96a405b>2009-11-06 17:09:01 +0000
commitfb746bd765236570ed86435a08a6d12b2d1b74e2 (patch)
tree77da5cbcde82e187fd07e1d122ee8cce5937527c /codecs
parent4286b8c9d8a8614633c3095343bcfd614cd276f9 (diff)
Merged revisions 228418 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r228418 | dvossel | 2009-11-06 11:07:13 -0600 (Fri, 06 Nov 2009) | 13 lines fixes segfault in iLBC For reasons not yet known, it appears possible for an ast_frame to have a datalen greater than zero while the actual data is NULL during Packet Loss Concealment. Most codecs don't support PLC so this doesn't affect them. This patch catches the malformed frame and prevents the crash from occuring. Additional efforts to determine why it is possible for a frame to look like this are still being investigated. (issue #16979) ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@228420 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'codecs')
-rw-r--r--codecs/codec_ilbc.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/codecs/codec_ilbc.c b/codecs/codec_ilbc.c
index c01b2f740..f7665649d 100644
--- a/codecs/codec_ilbc.c
+++ b/codecs/codec_ilbc.c
@@ -88,6 +88,11 @@ static int ilbctolin_framein(struct ast_trans_pvt *pvt, struct ast_frame *f)
int16_t *dst = pvt->outbuf.i16;
float tmpf[ILBC_SAMPLES];
+ if (!f->data && f->datalen) {
+ ast_log(LOG_DEBUG, "issue 16070, ILIB ERROR. data = NULL datalen = %d src = %s\n", f->datalen, f->src ? f->src : "no src set");
+ f->datalen = 0;
+ }
+
if (f->datalen == 0) { /* native PLC, set fake f->datalen and clear plc_mode */
f->datalen = ILBC_FRAME_LEN;
f->samples = ILBC_SAMPLES;