[xiph-cvs] cvs commit: speex/libspeex bits.c
Jean-Marc Valin
jm at xiph.org
Fri Aug 22 14:45:02 PDT 2003
jm 03/08/22 17:45:02
Modified: libspeex Tag: rel-1-0-branch bits.c
Log:
speex_bits_write now properly inserts a terminator before copying the data
Revision Changes Path
No revision
<p>No revision
<p>1.27.2.2 +11 -0 speex/libspeex/bits.c
Index: bits.c
===================================================================
RCS file: /usr/local/cvsroot/speex/libspeex/bits.c,v
retrieving revision 1.27.2.1
retrieving revision 1.27.2.2
diff -u -r1.27.2.1 -r1.27.2.2
--- bits.c 31 May 2003 06:00:07 -0000 1.27.2.1
+++ bits.c 22 Aug 2003 21:45:02 -0000 1.27.2.2
@@ -166,6 +166,17 @@
int speex_bits_write(SpeexBits *bits, char *bytes, int max_len)
{
int i;
+ char bytePtr, bitPtr, nbBits;
+
+ /* Insert terminator, but save the data so we can put it back after */
+ bitPtr=bits->bitPtr;
+ bytePtr=bits->bytePtr;
+ nbBits=bits->nbBits;
+ speex_bits_insert_terminator(bits);
+ bits->bitPtr=bitPtr;
+ bits->bytePtr=bytePtr;
+ bits->nbBits=nbBits;
+
if (max_len > ((bits->nbBits+7)>>3))
max_len = ((bits->nbBits+7)>>3);
for (i=0;i<max_len;i++)
<p><p>--- >8 ----
List archives: http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'cvs-request at xiph.org'
containing only the word 'unsubscribe' in the body. No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.
More information about the commits
mailing list