From 7119ebd59947c8514317efafc6a7ebb2e9172654 Mon Sep 17 00:00:00 2001 From: marco Date: Sat, 21 Aug 2010 04:33:51 +0000 Subject: [PATCH] * patch from Dmitry for bug #7604, fixing the CRC problems. git-svn-id: trunk@15864 - --- packages/unzip/src/unzip51g.pp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/packages/unzip/src/unzip51g.pp b/packages/unzip/src/unzip51g.pp index 79d1250339..1de27749cc 100644 --- a/packages/unzip/src/unzip51g.pp +++ b/packages/unzip/src/unzip51g.pp @@ -2410,8 +2410,18 @@ BEGIN originalcrc := b AND $FFFF; dumpbits ( 16 ); needbits ( 16 ); - originalcrc := ( b AND $FFFF ) SHL 16; + originalcrc := originalcrc OR LongWord(( b AND $FFFF ) SHL 16); dumpbits ( 16 ); + + IF originalcrc = $08074b50 THEN BEGIN + { skiping possible $08074b50 data descriptor signature. see PKWARE APPNOTE.txt } + needbits ( 16 ); + originalcrc := b AND $FFFF; + dumpbits ( 16 ); + needbits ( 16 ); + originalcrc := originalcrc OR LongWord(( b AND $FFFF ) SHL 16); + dumpbits ( 16 ); + END; END; close ( infile );