Author: titmuss
Date: Tue Jan  6 09:38:27 2009
New Revision: 3697

URL: http://svn.slimdevices.com?rev=3697&root=Jive&view=rev
Log:
Bug: 10542
Description:
Updated flac patch from Josh Coalson.


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

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=3697&root=Jive&r1=3696&r2=3697&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 
09:38:27 2009
@@ -1057,7 +1057,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 >> end)) << cbits;
                                if(b) {
@@ -1070,7 +1070,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... */
                                }

Modified: 
7.3/trunk/squeezeplay/src/flac-1.2.1/src/libFLAC/ia32/bitreader_asm.nasm
URL: 
http://svn.slimdevices.com/7.3/trunk/squeezeplay/src/flac-1.2.1/src/libFLAC/ia32/bitreader_asm.nasm?rev=3697&root=Jive&r1=3696&r2=3697&view=diff
==============================================================================
--- 7.3/trunk/squeezeplay/src/flac-1.2.1/src/libFLAC/ia32/bitreader_asm.nasm 
(original)
+++ 7.3/trunk/squeezeplay/src/flac-1.2.1/src/libFLAC/ia32/bitreader_asm.nasm 
Tue Jan  6 09:38:27 2009
@@ -272,10 +272,11 @@
        ;; edi          uval
        ;; ebp          br
        mov     edx, [ebp + 12]         ;     edx <- br->bytes
-       test    edx, edx
-       jz      .read1                  ;     if(br->bytes) {  [NOTE: this case 
is rare so it doesn't have to be all that fast ]
+       shl     edx, 3                  ;     edx <- br->bytes*8
+       cmp     edx, ecx
+       jbe     .read1                  ;     if(br->bytes*8 > cbits) {  [NOTE: 
this case is rare so it doesn't have to be all that fast ]
        mov     ebx, [ebp]
-       shl     edx, 3                  ;       edx <- const unsigned end = 
br->bytes * 8;
+                                       ;       edx <- const unsigned end = 
br->bytes * 8;
        mov     eax, [ebx + 4*esi]      ;       b = br->buffer[cwords]
        xchg    edx, ecx                ;       [edx <- cbits , ecx <- end]
        mov     ebx, 0xffffffff         ;       ebx <- FLAC__WORD_ALL_ONES
@@ -296,7 +297,7 @@
 .c1_next3:                             ;       } else {
        sub     edi, ecx
        add     edi, edx                ;         uval += end - cbits;
-       add     ecx, edx                ;         cbits += end
+       mov     ecx, edx                ;         cbits = end
                                        ;         /* 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