aboutsummaryrefslogtreecommitdiffstats
path: root/main/channel.c
diff options
context:
space:
mode:
authordvossel <dvossel@f38db490-d61c-443f-a65b-d21fe96a405b>2010-05-24 16:10:09 +0000
committerdvossel <dvossel@f38db490-d61c-443f-a65b-d21fe96a405b>2010-05-24 16:10:09 +0000
commit89fe54c8df1f549c7e5851c4a9ca886d5fd26190 (patch)
treefa72aa025197a9047d480a130232e31ba748a5be /main/channel.c
parent16f7f9022b2cb4818818f84e9d024a451a71f63f (diff)
fixes segfault when using generic plc
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@265273 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/channel.c')
-rw-r--r--main/channel.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/main/channel.c b/main/channel.c
index 637f16285..ba34117e0 100644
--- a/main/channel.c
+++ b/main/channel.c
@@ -4154,6 +4154,12 @@ 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.