From: Yann Collet Date: Thu, 16 Jun 2016 13:38:51 +0000 (+0200) Subject: make room for reserved "information bit" in frame header X-Git-Tag: v0.7.0^2~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4948f270b36e81f753e4f8d9c8dd4388103e8b76;p=thirdparty%2Fzstd.git make room for reserved "information bit" in frame header --- diff --git a/NEWS b/NEWS index c7aeae98d..dc2d66bc1 100644 --- a/NEWS +++ b/NEWS @@ -5,8 +5,9 @@ New : Visual build scripts, by Christophe Chevalier New : Support for Sparse File-systems (do not use space for zero-filled sectors) New : Frame checksum support New : Support pass-through mode (when using `-df`) -New : API : dictionary files from custom content, by Giuseppe Ottaviano -New : API support for custom malloc/free functions +API : more efficient Dictionary API : `ZSTD_compress_usingCDict()`, `ZSTD_decompress_usingDDict()` +API : create dictionary files from custom content, by Giuseppe Ottaviano +API : support for custom malloc/free functions New : controllable Dictionary ID New : Support for skippable frames diff --git a/lib/decompress/zstd_decompress.c b/lib/decompress/zstd_decompress.c index 1763499d1..b22021ed7 100644 --- a/lib/decompress/zstd_decompress.c +++ b/lib/decompress/zstd_decompress.c @@ -223,8 +223,10 @@ void ZSTD_copyDCtx(ZSTD_DCtx* dstDCtx, const ZSTD_DCtx* srcDCtx) // new 1 byte - FrameHeaderDescription : bit 0-1 : dictID (0, 1, 2 or 4 bytes) - bit 2-4 : reserved (must be zero) - bit 5 : SkippedWindowLog (if 1, WindowLog byte is not present) + bit 2 : checksumFlag + bit 3 : reserved (must be zero) + bit 4 : reserved (unused, can be any value) + bit 5 : Single Segment (if 1, WindowLog byte is not present) bit 6-7 : FrameContentFieldSize (0, 2, 4, or 8) if (SkippedWindowLog && !FrameContentFieldsize) FrameContentFieldsize=1; @@ -365,7 +367,7 @@ size_t ZSTD_getFrameParams(ZSTD_frameParams* fparamsPtr, const void* src, size_t U32 windowSize = 0; U32 dictID = 0; U64 frameContentSize = 0; - if ((fhdByte & 0x18) != 0) return ERROR(frameParameter_unsupported); /* reserved bits */ + if ((fhdByte & 0x08) != 0) return ERROR(frameParameter_unsupported); /* reserved bits, which must be zero */ if (!directMode) { BYTE const wlByte = ip[pos++]; U32 const windowLog = (wlByte >> 3) + ZSTD_WINDOWLOG_ABSOLUTEMIN;