diff options
author | Xin LI <delphij@FreeBSD.org> | 2019-08-11 06:22:06 +0000 |
---|---|---|
committer | Xin LI <delphij@FreeBSD.org> | 2019-08-11 06:22:06 +0000 |
commit | fb69e223e528e6e4c1411ced8b7c9f07024dc280 (patch) | |
tree | 5bf79f136083c728f49d752159d80b85439f8815 /decompress.c | |
parent | 7897e22279d3ecd2cadda971da4a5bf96bbee785 (diff) | |
download | src-fb69e223e528e6e4c1411ced8b7c9f07024dc280.tar.gz src-fb69e223e528e6e4c1411ced8b7c9f07024dc280.zip |
Vendor import bzip2 -- upgrade to version 1.0.8.vendor/bzip2/1.0.8vendor/bzip2
Notes
Notes:
svn path=/vendor/bzip2/dist/; revision=350853
svn path=/vendor/bzip2/1.0.8/; revision=350854; tag=vendor/bzip2/1.0.8
Diffstat (limited to 'decompress.c')
-rw-r--r-- | decompress.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/decompress.c b/decompress.c index 20ce4936cdfb..a1a0bac89227 100644 --- a/decompress.c +++ b/decompress.c @@ -8,8 +8,8 @@ This file is part of bzip2/libbzip2, a program and library for lossless, block-sorting data compression. - bzip2/libbzip2 version 1.0.7 of 27 June 2019 - Copyright (C) 1996-2010 Julian Seward <jseward@acm.org> + bzip2/libbzip2 version 1.0.8 of 13 July 2019 + Copyright (C) 1996-2019 Julian Seward <jseward@acm.org> Please read the WARNING, DISCLAIMER and PATENTS sections in the README file. @@ -287,7 +287,7 @@ Int32 BZ2_decompress ( DState* s ) GET_BITS(BZ_X_SELECTOR_1, nGroups, 3); if (nGroups < 2 || nGroups > BZ_N_GROUPS) RETURN(BZ_DATA_ERROR); GET_BITS(BZ_X_SELECTOR_2, nSelectors, 15); - if (nSelectors < 1 || nSelectors > BZ_MAX_SELECTORS) RETURN(BZ_DATA_ERROR); + if (nSelectors < 1) RETURN(BZ_DATA_ERROR); for (i = 0; i < nSelectors; i++) { j = 0; while (True) { @@ -296,8 +296,14 @@ Int32 BZ2_decompress ( DState* s ) j++; if (j >= nGroups) RETURN(BZ_DATA_ERROR); } - s->selectorMtf[i] = j; + /* Having more than BZ_MAX_SELECTORS doesn't make much sense + since they will never be used, but some implementations might + "round up" the number of selectors, so just ignore those. */ + if (i < BZ_MAX_SELECTORS) + s->selectorMtf[i] = j; } + if (nSelectors > BZ_MAX_SELECTORS) + nSelectors = BZ_MAX_SELECTORS; /*--- Undo the MTF values for the selectors. ---*/ { |