]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
make room for reserved "information bit" in frame header
authorYann Collet <yann.collet.73@gmail.com>
Thu, 16 Jun 2016 13:38:51 +0000 (15:38 +0200)
committerYann Collet <yann.collet.73@gmail.com>
Thu, 16 Jun 2016 13:38:51 +0000 (15:38 +0200)
NEWS
lib/decompress/zstd_decompress.c

diff --git a/NEWS b/NEWS
index c7aeae98dfaa4eda64435a13295812f45b749a5d..dc2d66bc191c8f39358a1e7fd3496c3dc884a0be 100644 (file)
--- 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
 
index 1763499d1275e258b5107f4c430167d1f1e26287..b22021ed7d131c6334236a043a9a5a404cb0db0c 100644 (file)
@@ -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;