Author: titmuss
Date: Tue Jan  6 02:58:38 2009
New Revision: 3682

URL: http://svn.slimdevices.com?rev=3682&root=Jive&view=rev
Log:
Bug: 10542
Description:
Fix from Josh Coalson for libFLAC to solve audio playback problems.


Modified:
    7.3/trunk/squeezeplay/src/flac-1.2.1/src/libFLAC/bitreader.c

Modified: 7.3/trunk/squeezeplay/src/flac-1.2.1/src/libFLAC/bitreader.c
URL: 
http://svn.slimdevices.com/7.3/trunk/squeezeplay/src/flac-1.2.1/src/libFLAC/bitreader.c?rev=3682&root=Jive&r1=3681&r2=3682&view=diff
==============================================================================
--- 7.3/trunk/squeezeplay/src/flac-1.2.1/src/libFLAC/bitreader.c (original)
+++ 7.3/trunk/squeezeplay/src/flac-1.2.1/src/libFLAC/bitreader.c Tue Jan  6 
02:58:38 2009
@@ -751,7 +751,7 @@
                 * us data a byte at a time (unlikely), br->consumed_bits may 
not
                 * be zero.
                 */
-               if(br->bytes) {
+               if(br->bytes*8 > br->consumed_bits) {
                        const unsigned end = br->bytes * 8;
                        brword b = (br->buffer[br->consumed_words] & 
(FLAC__WORD_ALL_ONES << (FLAC__BITS_PER_WORD-end))) << br->consumed_bits;
                        if(b) {
@@ -764,7 +764,7 @@
                        }
                        else {
                                *val += end - br->consumed_bits;
-                               br->consumed_bits += end;
+                               br->consumed_bits = end;
                                FLAC__ASSERT(br->consumed_bits < 
FLAC__BITS_PER_WORD);
                                /* didn't find stop bit yet, have to keep 
going... */
                        }
@@ -874,7 +874,7 @@
                         * us data a byte at a time (unlikely), 
br->consumed_bits may not
                         * be zero.
                         */
-                       if(br->bytes) {
+                       if(br->bytes*8 > cbits) {
                                const unsigned end = br->bytes * 8;
                                brword b = (br->buffer[cwords] & 
(FLAC__WORD_ALL_ONES << (FLAC__BITS_PER_WORD-end))) << cbits;
                                if(b) {
@@ -888,7 +888,7 @@
                                }
                                else {
                                        uval += end - cbits;
-                                       cbits += end;
+                                       cbits = end;
                                        FLAC__ASSERT(cbits < 
FLAC__BITS_PER_WORD);
                                        /* didn't find stop bit yet, have to 
keep going... */
                                }

_______________________________________________
Jive-checkins mailing list
[email protected]
http://lists.slimdevices.com/cgi-bin/mailman/listinfo/jive-checkins

Reply via email to