From ec6021afa8d674e104276f34f5167fed53650897 Mon Sep 17 00:00:00 2001 From: Andy McFadden Date: Thu, 10 Oct 2002 00:46:58 +0000 Subject: [PATCH] Fixed a bug in CRC handling when using LZW/1. --- nufxlib-0/Lzw.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/nufxlib-0/Lzw.c b/nufxlib-0/Lzw.c index 090d3aa..336ff16 100644 --- a/nufxlib-0/Lzw.c +++ b/nufxlib-0/Lzw.c @@ -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 - * 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, - lzwState->inputBuf, blockSize); - } else { - *pThreadCrc = Nu_CalcCRC16(*pThreadCrc, - lzwState->inputBuf, kNuLZWBlockSize); + *pThreadCrc = Nu_CalcCRC16(*pThreadCrc, + lzwState->inputBuf, blockSize); + if (!isType2) { lzwState->chunkCrc = Nu_CalcCRC16(lzwState->chunkCrc, lzwState->inputBuf, kNuLZWBlockSize); }