Function zstd_sys::ZSTD_DCtx_setMaxWindowSize [] [src]

pub unsafe extern "C" fn ZSTD_DCtx_setMaxWindowSize(
    dctx: *mut ZSTD_DCtx,
    maxWindowSize: usize
) -> usize

ZSTD_DCtx_setMaxWindowSize() : Refuses allocating internal buffers for frames requiring a window size larger than provided limit. This is useful to prevent a decoder context from reserving too much memory for itself (potential attack scenario). This parameter is only useful in streaming mode, since no internal buffer is allocated in direct mode. By default, a decompression context accepts all window sizes <= (1 << ZSTD_WINDOWLOG_MAX) @return : 0, or an error code (which can be tested using ZSTD_isError()).