[xiph-commits] r11343 - trunk/speex/src

jm at svn.xiph.org jm at svn.xiph.org
Thu May 4 09:10:59 PDT 2006


Author: jm
Date: 2006-05-04 09:10:56 -0700 (Thu, 04 May 2006)
New Revision: 11343

Modified:
   trunk/speex/src/speexdec.c
Log:
fixed a segfault when using --force-nb on a wideband stream (still need to
make it have the correct behaviour)


Modified: trunk/speex/src/speexdec.c
===================================================================
--- trunk/speex/src/speexdec.c	2006-05-04 15:19:28 UTC (rev 11342)
+++ trunk/speex/src/speexdec.c	2006-05-04 16:10:56 UTC (rev 11343)
@@ -313,7 +313,7 @@
       fprintf (stderr, "Cannot read header\n");
       return NULL;
    }
-   if (header->mode >= SPEEX_NB_MODES)
+   if (header->mode >= SPEEX_NB_MODES || header->mode<0)
    {
       fprintf (stderr, "Mode number %d does not (yet/any longer) exist in this version\n", 
                header->mode);
@@ -600,6 +600,7 @@
          page_nb_packets = ogg_page_packets(&og);
          if (page_granule>0 && frame_size)
          {
+            /* FIXME: shift the granule values if --force-* is specified */
             skip_samples = page_nb_packets*frame_size*nframes - (page_granule-last_granule);
             if (ogg_page_eos(&og))
                skip_samples = -skip_samples;
@@ -709,7 +710,7 @@
                            new_frame_size = frame_size;
                         /*printf ("chopping end: %d %d %d\n", new_frame_size, packet_length, packet_no);*/
                      }
-                     if (new_frame_size)
+                     if (new_frame_size>0)
                      {  
 #if defined WIN32 || defined _WIN32
                         if (strlen(outFile)==0)



More information about the commits mailing list