[xiph-cvs] cvs commit: vorbis/lib psy.c

Monty xiphmont at xiph.org
Wed Jan 31 18:10:56 PST 2001



xiphmont    01/01/31 18:10:56

  Modified:    lib      psy.c
  Log:
  Another segfault fix (real this time) to bark_noise_median

Revision  Changes    Path
1.39      +2 -0      vorbis/lib/psy.c

Index: psy.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis/lib/psy.c,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -r1.38 -r1.39
--- psy.c	2001/02/01 01:29:17	1.38
+++ psy.c	2001/02/01 02:10:55	1.39
@@ -12,7 +12,7 @@
  ********************************************************************
 
  function: psychoacoustics not including preecho
- last mod: $Id: psy.c,v 1.38 2001/02/01 01:29:17 xiphmont Exp $
+ last mod: $Id: psy.c,v 1.39 2001/02/01 02:10:55 xiphmont Exp $
 
  ********************************************************************/
 
@@ -564,6 +564,7 @@
     for(;hi<n && (hi<i+himin || b[hi]<=bi+hiwidth);hi++){
       int bin=BIN(f[hi]);
       if(bin>LASTBIN)bin=LASTBIN;
+      if(bin<0)bin=0;
       radix[bin]++;
       if(bin<median)
         countabove++;
@@ -573,6 +574,7 @@
     for(;lo<i && lo+lomin<i && b[lo]+lowidth<=bi;lo++){
       int bin=BIN(f[lo]);
       if(bin>LASTBIN)bin=LASTBIN;
+      if(bin<0)bin=0;
       radix[bin]--;
       if(bin<median)
         countabove--;

--- >8 ----
List archives:  http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'cvs-request at xiph.org'
containing only the word 'unsubscribe' in the body.  No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.



More information about the commits mailing list