[Speex-dev] Quick bug in speexenc

Jean-Marc Valin jean-marc.valin at usherbrooke.ca
Wed Feb 13 02:18:47 PST 2008


Can you explain a bit what you mean by a negative size and how you'd get
that?

	Jean-Marc

Michel Donais a écrit :
> 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
> 
>  
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Speex-dev mailing list
> Speex-dev at xiph.org
> http://lists.xiph.org/mailman/listinfo/speex-dev


More information about the Speex-dev mailing list