From: David Vossel Date: Mon, 24 May 2010 19:37:55 +0000 (+0000) Subject: fixes segfault when using generic plc X-Git-Tag: 1.4.33-rc1~14 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=6105e07933f539da6901d085d76f22a563449201;p=thirdparty%2Fasterisk.git fixes segfault when using generic plc git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@265365 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/main/channel.c b/main/channel.c index 15dba8684b..0f3413362e 100644 --- a/main/channel.c +++ b/main/channel.c @@ -2938,6 +2938,11 @@ static void adjust_frame_for_plc(struct ast_channel *chan, struct ast_frame *fra int num_new_samples = frame->samples; struct plc_ds *plc = datastore->data; + /* If this audio frame has no samples to fill in, ignore it */ + if (!num_new_samples) { + return; + } + /* First, we need to be sure that our buffer is large enough to accomodate * the samples we need to fill in. This will likely only occur on the first * frame we write.