Fixed a bug in CRC handling when using LZW/1.

This commit is contained in:
Andy McFadden 2002-10-10 00:46:58 +00:00
parent 0b7151b6f5
commit ec6021afa8

View File

@ -648,14 +648,11 @@ Nu_CompressLZW(NuArchive* pArchive, NuStraw* pStraw, FILE* fp,
/* /*
* Compute the CRC. For LZW/1 this is on the entire 4K block, for * Compute the CRC. For LZW/1 this is on the entire 4K block, for
* LZW/2 this is on just the "real" data. * the "version 3" thread CRC this is on just the "real" data.
*/ */
if (isType2) { *pThreadCrc = Nu_CalcCRC16(*pThreadCrc,
*pThreadCrc = Nu_CalcCRC16(*pThreadCrc, lzwState->inputBuf, blockSize);
lzwState->inputBuf, blockSize); if (!isType2) {
} else {
*pThreadCrc = Nu_CalcCRC16(*pThreadCrc,
lzwState->inputBuf, kNuLZWBlockSize);
lzwState->chunkCrc = Nu_CalcCRC16(lzwState->chunkCrc, lzwState->chunkCrc = Nu_CalcCRC16(lzwState->chunkCrc,
lzwState->inputBuf, kNuLZWBlockSize); lzwState->inputBuf, kNuLZWBlockSize);
} }