diff options
author | dvossel <dvossel@f38db490-d61c-443f-a65b-d21fe96a405b> | 2010-05-24 19:37:55 +0000 |
---|---|---|
committer | dvossel <dvossel@f38db490-d61c-443f-a65b-d21fe96a405b> | 2010-05-24 19:37:55 +0000 |
commit | c0a9e37b403684e00f0095efe8ca3bbc46e0ea55 (patch) | |
tree | 20cfcc57d8d37585b547d16d05a9fd37b5ae01ad | |
parent | 2602d4ce5b98436b6908ac484c182526c4e9d4db (diff) |
fixes segfault when using generic plc
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@265365 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r-- | main/channel.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/main/channel.c b/main/channel.c index 15dba8684..0f3413362 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. |