Diffstat (limited to 'core/multimedia/opieplayer/modplug/load_ams.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/multimedia/opieplayer/modplug/load_ams.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/core/multimedia/opieplayer/modplug/load_ams.cpp b/core/multimedia/opieplayer/modplug/load_ams.cpp index 3dd1c2b..ad1cc01 100644 --- a/core/multimedia/opieplayer/modplug/load_ams.cpp +++ b/core/multimedia/opieplayer/modplug/load_ams.cpp | |||
@@ -597,35 +597,35 @@ void AMSUnpack(const char *psrc, UINT inputlen, char *pdest, UINT dmax, char pac | |||
597 | UINT bitcount = 0x80, dh; | 597 | UINT bitcount = 0x80, dh; |
598 | UINT k=0; | 598 | UINT k=0; |
599 | for (UINT i=0; i<dmax; i++) | 599 | for (UINT i=0; i<dmax; i++) |
600 | { | 600 | { |
601 | BYTE al = *p++; | 601 | BYTE al = *p++; |
602 | dh = 0; | 602 | dh = 0; |
603 | for (UINT count=0; count<8; count++) | 603 | for (UINT count=0; count<8; count++) |
604 | { | 604 | { |
605 | UINT bl = al & bitcount; | 605 | UINT bl = al & bitcount; |
606 | bl = ((bl|(bl<<8)) >> ((dh+8-count) & 7)) & 0xFF; | 606 | bl = ((bl|(bl<<8)) >> ((dh+8-count) & 7)) & 0xFF; |
607 | bitcount = ((bitcount|(bitcount<<8)) >> 1) & 0xFF; | 607 | bitcount = ((bitcount|(bitcount<<8)) >> 1) & 0xFF; |
608 | pdest[k++] |= bl; | 608 | pdest[k++] |= bl; |
609 | if (k >= dmax) | 609 | if (k >= dmax) |
610 | { | 610 | { |
611 | k = 0; | 611 | k = 0; |
612 | dh++; | 612 | dh++; |
613 | } | 613 | } |
614 | } | 614 | } |
615 | bitcount = ((bitcount|(bitcount<<8)) >> dh) & 0xFF; | 615 | bitcount = ((bitcount|(bitcount<<8)) >> dh) & 0xFF; |
616 | } | 616 | } |
617 | } | 617 | } |
618 | // Delta Unpack | 618 | // Delta Unpack |
619 | { | 619 | { |
620 | signed char old = 0; | 620 | signed char old = 0; |
621 | for (UINT i=0; i<dmax; i++) | 621 | for (UINT i=0; i<dmax; i++) |
622 | { | 622 | { |
623 | int pos = ((LPBYTE)pdest)[i]; | 623 | int pos = ((LPBYTE)pdest)[i]; |
624 | if ((pos != 128) && (pos & 0x80)) pos = -(pos & 0x7F); | 624 | if ((pos != 128) && (pos & 0x80)) pos = -(pos & 0x7F); |
625 | old -= (signed char)pos; | 625 | old -= (signed char)pos; |
626 | pdest[i] = old; | 626 | pdest[i] = old; |
627 | } | 627 | } |
628 | } | 628 | } |
629 | delete amstmp; | 629 | delete [] amstmp; |
630 | } | 630 | } |
631 | 631 | ||