[xiph-commits] r14504 - in trunk/speex: libspeex src

jm at svn.xiph.org jm at svn.xiph.org
Wed Feb 13 15:32:55 PST 2008


Author: jm
Date: 2008-02-13 15:32:54 -0800 (Wed, 13 Feb 2008)
New Revision: 14504

Modified:
   trunk/speex/libspeex/speex_header.c
   trunk/speex/src/speexdec.c
Log:
Fix for nb-channel bug found by gmaxwell's fuzzing.


Modified: trunk/speex/libspeex/speex_header.c
===================================================================
--- trunk/speex/libspeex/speex_header.c	2008-02-13 22:08:18 UTC (rev 14503)
+++ trunk/speex/libspeex/speex_header.c	2008-02-13 23:32:54 UTC (rev 14504)
@@ -178,6 +178,11 @@
    ENDIAN_SWITCH(le_header->frames_per_packet);
    ENDIAN_SWITCH(le_header->extra_headers);
 
+   if (le_header->nb_channels>2)
+      le_header->nb_channels = 2;
+   if (le_header->nb_channels<1)
+      le_header->nb_channels = 1;
+
    return le_header;
 
 }

Modified: trunk/speex/src/speexdec.c
===================================================================
--- trunk/speex/src/speexdec.c	2008-02-13 22:08:18 UTC (rev 14503)
+++ trunk/speex/src/speexdec.c	2008-02-13 23:32:54 UTC (rev 14504)
@@ -365,6 +365,7 @@
 
    if (!(*channels==1))
    {
+      channels = 2;
       callback.callback_id = SPEEX_INBAND_STEREO;
       callback.func = speex_std_stereo_request_handler;
       callback.data = stereo;



More information about the commits mailing list