[xiph-cvs] cvs commit: speex/libspeex bits.c

Jean-Marc Valin jm at xiph.org
Fri Aug 22 14:44:42 PDT 2003



jm          03/08/22 17:44:42

  Modified:    libspeex bits.c
  Log:
  speex_bits_write now properly inserts a terminator before copying the data

Revision  Changes    Path
1.29      +11 -0     speex/libspeex/bits.c

Index: bits.c
===================================================================
RCS file: /usr/local/cvsroot/speex/libspeex/bits.c,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -r1.28 -r1.29
--- bits.c	30 May 2003 19:44:54 -0000	1.28
+++ bits.c	22 Aug 2003 21:44:42 -0000	1.29
@@ -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