[Speex-dev] Quick bug in speexenc

Michel Donais michel at ludia.com
Fri Feb 8 15:02:36 PST 2008


Good day, a quick bug while encoding speexes in speexenc.

 

While reading a .wav in function read_samples, size can get to negative
values, as long as fread is able to go forward with reading the file. This
can happen with Protools-generated wavs, where they put additional
information after the "data" fourcc.

 

I created a very quick hack by adding:

 

         int tentative_read = bits/8*channels* frame_size;

         if (*size < 0) {

               tentative_read = tentative_read + *size;    /* Size is
negative, don't forget ;) */

         }

      nb_read = fread(in,1,tentative_read, fin);

 

instead of the original fread.

 

This is a very dirty hack, but it works well using my strange .wavs. Cleanup
more than required ;)

 

 

Thanks

Michel

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.xiph.org/pipermail/speex-dev/attachments/20080208/cca68d04/attachment-0001.htm


More information about the Speex-dev mailing list