Skip to content

Ques: can any version of the zstd SW produce a compressed file where Block_Content > Block_Maximum_Size #4744

Open

Description

@qahsan99

Please refer #4669 .

The version v1.5.4 can decompress a file that has Block_Content > Block_Maximum_Size but version v1.5.7 correctly raises an error.

my question is can any of the SW version create a file that violates Block_Content cannot be greater than Block_Maximum_Size

Activity

  1. sebres commented on Sep 9, 2026

    @sebres
    Contributor

    It is impossible, because a valid zstd frame cannot contain a block whose original (uncompressed) size exceeds Block_Maximum_Size. The Zstandard specification explicitly prohibits this (see RFC 8878, 3.1.1.2.4):
    Block_Maximum_Size is constant for a given frame. This maximum is applicable to both the decompressed size and the compressed size of any block in the frame.
    The key point is that exceeding Block_Maximum_Size is a protocol violation (for both sizes - compressed and uncompressed block). With other words, if some SW does that, it is not valid zstd frame or not a standard zstd.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions