Revert changes made in version 1.6. They introduced a heuristic for

detecting corruption, which may have prevented coredumps for
real corruption cases, but in practice caused false positives.
This commit is contained in:
fvdl 1999-11-02 21:16:55 +00:00
parent 1899563c96
commit 7941fc97fb
1 changed files with 5 additions and 19 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: decompress.c,v 1.7 1999/08/30 05:12:58 simonb Exp $ */
/* $NetBSD: decompress.c,v 1.8 1999/11/02 21:16:55 fvdl Exp $ */
/*-------------------------------------------------------------*/
/*--- Decompression machinery ---*/
@ -62,14 +62,6 @@
#include "bzlib_private.h"
/*--
XXX: The following are the maximum observed values in the
GET_MTF_VAL macro for each label pair (simonb 19990820).
--*/
#define MAX_MTF_ZVEC_12 65536
#define MAX_MTF_ZVEC_34 131072
#define MAX_MTF_ZVEC_56 131072
/*---------------------------------------------------*/
static
@ -118,7 +110,7 @@ void makeMaps_d ( DState* s )
GET_BITS(lll,uuu,1)
/*---------------------------------------------------*/
#define GET_MTF_VAL(label1,label2,lval,maxzvec) \
#define GET_MTF_VAL(label1,label2,lval) \
{ \
if (groupPos == 0) { \
groupNo++; \
@ -136,13 +128,7 @@ void makeMaps_d ( DState* s )
zn++; \
GET_BIT(label2, zj); \
zvec = (zvec << 1) | zj; \
if (zvec > maxzvec) \
RETURN(BZ_DATA_ERROR); \
if (zn > BZ_MAX_ALPHA_SIZE) \
RETURN(BZ_DATA_ERROR); \
}; \
if (zvec - gBase[zn] > BZ_MAX_ALPHA_SIZE) \
RETURN(BZ_DATA_ERROR); \
lval = gPerm[zvec - gBase[zn]]; \
}
@ -408,7 +394,7 @@ Int32 _BZdecompress ( DState* s )
nblock = 0;
GET_MTF_VAL(BZ_X_MTF_1, BZ_X_MTF_2, nextSym, MAX_MTF_ZVEC_12);
GET_MTF_VAL(BZ_X_MTF_1, BZ_X_MTF_2, nextSym);
while (True) {
@ -422,7 +408,7 @@ Int32 _BZdecompress ( DState* s )
if (nextSym == BZ_RUNA) es = es + (0+1) * N; else
if (nextSym == BZ_RUNB) es = es + (1+1) * N;
N = N * 2;
GET_MTF_VAL(BZ_X_MTF_3, BZ_X_MTF_4, nextSym, MAX_MTF_ZVEC_34);
GET_MTF_VAL(BZ_X_MTF_3, BZ_X_MTF_4, nextSym);
}
while (nextSym == BZ_RUNA || nextSym == BZ_RUNB);
@ -510,7 +496,7 @@ Int32 _BZdecompress ( DState* s )
s->tt[nblock] = (UInt32)(s->seqToUnseq[uc]);
nblock++;
GET_MTF_VAL(BZ_X_MTF_5, BZ_X_MTF_6, nextSym, MAX_MTF_ZVEC_56);
GET_MTF_VAL(BZ_X_MTF_5, BZ_X_MTF_6, nextSym);
continue;
}
}