diff options
author | Yann Collet <yann.collet.73@gmail.com> | 2015-04-14 19:59:47 (GMT) |
---|---|---|
committer | Yann Collet <yann.collet.73@gmail.com> | 2015-04-14 19:59:47 (GMT) |
commit | 066e9d31d541d600346c26ef2da5d268bc3bd9e3 (patch) | |
tree | 7f42e59dd8803028e1cc50d697277321974734b1 | |
parent | 0dc8308f4c87a8e20d19eeaaea848c5ea1978eb4 (diff) | |
parent | 5a6652708439800e30d21e0cd24ed15cfb745a8b (diff) | |
download | lz4-066e9d31d541d600346c26ef2da5d268bc3bd9e3.zip lz4-066e9d31d541d600346c26ef2da5d268bc3bd9e3.tar.gz lz4-066e9d31d541d600346c26ef2da5d268bc3bd9e3.tar.bz2 |
Merge pull request #92 from Cyan4973/revert-89-descriptiveFrameErrors
Revert "Add more descriptive frame errors"
-rw-r--r-- | lib/lz4frame.c | 14 | ||||
-rw-r--r-- | lib/lz4frame_static.h | 5 |
2 files changed, 7 insertions, 12 deletions
diff --git a/lib/lz4frame.c b/lib/lz4frame.c index df41f63..31cf9a5 100644 --- a/lib/lz4frame.c +++ b/lib/lz4frame.c @@ -861,16 +861,16 @@ static size_t LZ4F_decodeHeader(LZ4F_dctx_internal_t* dctxPtr, const void* srcVo blockSizeID = (BD>>4) & _3BITS; /* validate */ - if (version != 1) return (size_t)-ERROR_version_wrong; /* Version Number, only supported value */ - if (blockChecksumFlag != 0) return (size_t)-ERROR_unsupported_checksum; /* Only supported value for the time being */ - if (((FLG>>0)&_2BITS) != 0) return (size_t)-ERROR_reserved_flag_set; /* Reserved bits */ - if (((BD>>7)&_1BIT) != 0) return (size_t)-ERROR_reserved_flag_set; /* Reserved bit */ - if (blockSizeID < 4) return (size_t)-ERROR_unsupported_block_size; /* 4-7 only supported values for the time being */ - if (((BD>>0)&_4BITS) != 0) return (size_t)-ERROR_reserved_flag_set; /* Reserved bits */ + if (version != 1) return (size_t)-ERROR_GENERIC; /* Version Number, only supported value */ + if (blockChecksumFlag != 0) return (size_t)-ERROR_GENERIC; /* Only supported value for the time being */ + if (((FLG>>0)&_2BITS) != 0) return (size_t)-ERROR_GENERIC; /* Reserved bits */ + if (((BD>>7)&_1BIT) != 0) return (size_t)-ERROR_GENERIC; /* Reserved bit */ + if (blockSizeID < 4) return (size_t)-ERROR_GENERIC; /* 4-7 only supported values for the time being */ + if (((BD>>0)&_4BITS) != 0) return (size_t)-ERROR_GENERIC; /* Reserved bits */ /* check */ HC = LZ4F_headerChecksum(srcPtr+4, frameHeaderSize-5); - if (HC != srcPtr[frameHeaderSize-1]) return (size_t)-ERROR_header_checksum_invalid; /* Bad header checksum error */ + if (HC != srcPtr[frameHeaderSize-1]) return (size_t)-ERROR_GENERIC; /* Bad header checksum error */ /* save */ dctxPtr->frameInfo.blockMode = (blockMode_t)blockMode; diff --git a/lib/lz4frame_static.h b/lib/lz4frame_static.h index b608d23..2e56400 100644 --- a/lib/lz4frame_static.h +++ b/lib/lz4frame_static.h @@ -57,11 +57,6 @@ extern "C" { ITEM(ERROR_wrongSrcPtr) \ ITEM(ERROR_decompressionFailed) \ ITEM(ERROR_checksum_invalid) \ - ITEM(ERROR_version_wrong) \ - ITEM(ERROR_unsupported_checksum) \ - ITEM(ERROR_reserved_flag_set) \ - ITEM(ERROR_unsupported_block_size) \ - ITEM(ERROR_header_checksum_invalid) \ ITEM(ERROR_maxCode) #define LZ4F_GENERATE_ENUM(ENUM) ENUM, |