[prev in list] [next in list] [prev in thread] [next in thread] 

List:       sox-commits
Subject:    [SoX-commits] [git] 97bea98f87 mcompand: fix bad clipping due to overflow of band summing.
From:       "Ulrich Klauer" <uklauer () users ! sourceforge ! net>
Date:       2013-02-17 16:59:38
Message-ID: E1U77aX-0002Gy-DL () sfs-ml-1 ! v29 ! ch3 ! sourceforge ! com
[Download RAW message or body]

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "sox".

The branch, master has been updated
       via  97bea98f87382d6abf885bd2e671dee845cad43b (commit)
      from  9f65df887ce6d6b3c8b5d6595f596e4a3eac61b5 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 97bea98f87382d6abf885bd2e671dee845cad43b
Author: Guido Aulisi <guido.aulisi@gmail.com>
Date:   Mon Nov 26 15:38:07 2012 +0100

    mcompand: fix bad clipping due to overflow of band summing.
    
    When summing bands in mcompand I got some bad unnoticed clipping,
    and the samples wrapped from positive to negative and viceversa.
    With many bands sox_sample_t intergers get wrapped before being cast
    to double.

diff --git a/ChangeLog b/ChangeLog
index e7f7316..a984706 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -38,6 +38,7 @@ Effects:
   o Improved pink noise frequency response in synth. (robs)
   o Extended syntax for specifying audio positions to several
     effects. (Ulrich Klauer)
+  o Fix integer overflow in mcompand. [3590093] (Guido Aulisi)
 
 Other new features:
 
diff --git a/src/mcompand.c b/src/mcompand.c
index e03f072..5682c5e 100644
--- a/src/mcompand.c
+++ b/src/mcompand.c
@@ -395,7 +395,7 @@ static int flow(sox_effect_t * effp, const sox_sample_t *ibuf, sox_sample_t *obu
     (void)sox_mcompand_flow_1(effp, c,l,bbuf,abuf,len, (size_t)effp->out_signal.channels);
     for (i=0;i<len;++i)
     {
-      out = obuf[i] + abuf[i];
+      out = (double)obuf[i] + (double)abuf[i];
       SOX_SAMPLE_CLIP_COUNT(out, effp->clips);
       obuf[i] = out;
     }

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog      |    1 +
 src/mcompand.c |    2 +-
 2 files changed, 2 insertions(+), 1 deletions(-)


hooks/post-receive
-- 
sox

------------------------------------------------------------------------------
The Go Parallel Website, sponsored by Intel - in partnership with Geeknet, 
is your hub for all things parallel software development, from weekly thought 
leadership blogs to news, videos, case studies, tutorials, tech docs, 
whitepapers, evaluation guides, and opinion stories. Check out the most 
recent posts - join the conversation now. http://goparallel.sourceforge.net/
_______________________________________________
SoX-commits mailing list
SoX-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sox-commits
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic