Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

zstd_stream_wrapper unintialized 'ret' member #30

Open
yglushki opened this issue Aug 8, 2024 · 0 comments
Open

zstd_stream_wrapper unintialized 'ret' member #30

yglushki opened this issue Aug 8, 2024 · 0 comments

Comments

@yglushki
Copy link

yglushki commented Aug 8, 2024

In case of decompression 'ret' member is unitialized in constructor - that causes sporadic failures.
In my case 'ret' gets value of 0xffffffffffffffff - generic error and constructor fails.

{
    if (this->isInput) {
        // Case of decompression - this->ret is not set.
        this->dctx = ZSTD_createDCtx();
        if (this->dctx == NULL) throw zstdException("ZSTD_createDCtx() failed!");
    } else {
        this->cctx = ZSTD_createCCtx();
        if (this->cctx == NULL) throw zstdException("ZSTD_createCCtx() failed!");
        this->ret = ZSTD_CCtx_setParameter(cctx, ZSTD_c_compressionLevel, level);
    }
    if (ZSTD_isError(this->ret)) throw zstdException(this->ret);

}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant