[Speex-dev] 1.2beta1 speex_bits_pack realloc issue?

Jean-Marc Valin jean-marc.valin at usherbrooke.ca
Tue Nov 21 17:04:33 PST 2006


Sorry about the mess. It was broken when applying the TI DSP patches
(see this patch: https://trac.xiph.org/changeset/9076 ). The fix is to
remove speex_memset_bytes(), but replace it with a line that clears the
first new byte allocate (or something like that -- I need to check).

I guess not many people use that feature because the bug's been there
for a while. You probably don't need to use it either because of
speex_bits_write_whole_bytes() that allow you to save the bits continuously.


Findlay, Dave wrote:
> In bits.c\speex_bits_pack there is logic to reallocate the bits buffer.
> In that section there is a call to speex_memset_bytes which appears to
> wipe out all the old bytes. I found when I encoded a multi-frame message
> that needed less than the default 2000 bytes for bits->chars, everything
> worked fine. However, when I encoded a longer message that triggered the
> realloc code in speex_bits_pack, all I got at decode was silence. When I
> commented out the call to speex_memset_bytes the problem went away.
> I see this memset in 1.1.12 bits.c but not in 1.1.6 bits.c. I was using
> 1.1.6 previously without having to change any code.
> Am I missing something?
> Cheers,
> Dave
> _______________________________________________
> 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