]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Merged revisions 265273 via svnmerge from
authorDavid Vossel <dvossel@digium.com>
Mon, 24 May 2010 19:30:45 +0000 (19:30 +0000)
committerDavid Vossel <dvossel@digium.com>
Mon, 24 May 2010 19:30:45 +0000 (19:30 +0000)
https://origsvn.digium.com/svn/asterisk/trunk

........
  r265273 | dvossel | 2010-05-24 11:10:09 -0500 (Mon, 24 May 2010) | 2 lines

  fixes segfault when using generic plc
........

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.6.2@265364 65c4cc65-6c06-0410-ace0-fbb531ad65f3

main/channel.c

index 426e6a7d943b26cbbc5bebbfb17bef2aa2ea1fa1..a1339fcf03ad2ee7d51ce369f11fea3aaf2f2a84 100644 (file)
@@ -3502,6 +3502,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.