]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
fixes segfault when using generic plc
authorDavid Vossel <dvossel@digium.com>
Mon, 24 May 2010 19:37:55 +0000 (19:37 +0000)
committerDavid Vossel <dvossel@digium.com>
Mon, 24 May 2010 19:37:55 +0000 (19:37 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@265365 65c4cc65-6c06-0410-ace0-fbb531ad65f3

main/channel.c

index 15dba8684b9fe2cf0bb6d9a216cd79f36d5c8da0..0f3413362e265838be54af4004f98f4686c73387 100644 (file)
@@ -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.