[xiph-commits] r12141 - trunk/speex/libspeex
jm at svn.xiph.org
jm at svn.xiph.org
Thu Nov 23 07:12:05 PST 2006
Author: jm
Date: 2006-11-23 07:12:03 -0800 (Thu, 23 Nov 2006)
New Revision: 12141
Modified:
trunk/speex/libspeex/bits.c
Log:
We should never have set all bits to zero when resizing. It's now actually
useless to set anything to zero.
Modified: trunk/speex/libspeex/bits.c
===================================================================
--- trunk/speex/libspeex/bits.c 2006-11-23 06:07:01 UTC (rev 12140)
+++ trunk/speex/libspeex/bits.c 2006-11-23 15:12:03 UTC (rev 12141)
@@ -76,6 +76,7 @@
void speex_bits_reset(SpeexBits *bits)
{
+ /* We only need to clear the first byte now */
bits->chars[0]=0;
bits->nbBits=0;
bits->charPtr=0;
@@ -225,11 +226,10 @@
speex_warning("Buffer too small to pack bits");
if (bits->owner)
{
- int new_nchars = ((bits->buf_size+5)*3)>>1;
+ int new_nchars = ((bits->buf_size+5)*3)>>1;
char *tmp = (char*)speex_realloc(bits->chars, new_nchars);
if (tmp)
{
- speex_memset_bytes(tmp, 0, new_nchars);
bits->buf_size=new_nchars;
bits->chars=tmp;
} else {
More information about the commits
mailing list