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 @@ -565,67 +565,67 @@ BOOL CSoundFile::ReadAMS2(LPCBYTE lpStream, DWORD dwMemLength) void AMSUnpack(const char *psrc, UINT inputlen, char *pdest, UINT dmax, char packcharacter) { UINT tmplen = dmax; signed char *amstmp = new signed char[tmplen]; if (!amstmp) return; // Unpack Loop { signed char *p = amstmp; UINT i=0, j=0; while ((i < inputlen) && (j < tmplen)) { signed char ch = psrc[i++]; if (ch == packcharacter) { BYTE ch2 = psrc[i++]; if (ch2) { ch = psrc[i++]; while (ch2--) { p[j++] = ch; if (j >= tmplen) break; } } else p[j++] = packcharacter; } else p[j++] = ch; } } // Bit Unpack Loop { signed char *p = amstmp; UINT bitcount = 0x80, dh; UINT k=0; for (UINT i=0; i<dmax; i++) { BYTE al = *p++; dh = 0; for (UINT count=0; count<8; count++) { UINT bl = al & bitcount; bl = ((bl|(bl<<8)) >> ((dh+8-count) & 7)) & 0xFF; bitcount = ((bitcount|(bitcount<<8)) >> 1) & 0xFF; pdest[k++] |= bl; if (k >= dmax) { k = 0; dh++; } } bitcount = ((bitcount|(bitcount<<8)) >> dh) & 0xFF; } } // Delta Unpack { signed char old = 0; for (UINT i=0; i<dmax; i++) { int pos = ((LPBYTE)pdest)[i]; if ((pos != 128) && (pos & 0x80)) pos = -(pos & 0x7F); old -= (signed char)pos; pdest[i] = old; } } - delete amstmp; + delete [] amstmp; } |