mirror of
https://github.com/google/sandboxed-api.git
synced 2024-03-22 13:11:30 +08:00
ZStandard: Add additional check of error code
This commit is contained in:
parent
7cb3f4a04d
commit
d0ce037fa2
|
@ -115,12 +115,14 @@ absl::Status CompressStream(ZstdApi& api, std::ifstream& in_file,
|
||||||
|
|
||||||
SAPI_ASSIGN_OR_RETURN(iserr, api.ZSTD_CCtx_setParameter(
|
SAPI_ASSIGN_OR_RETURN(iserr, api.ZSTD_CCtx_setParameter(
|
||||||
&rcctx, ZSTD_c_compressionLevel, level));
|
&rcctx, ZSTD_c_compressionLevel, level));
|
||||||
if (!iserr) {
|
SAPI_ASSIGN_OR_RETURN(iserr, api.ZSTD_isError(iserr))
|
||||||
|
if (iserr) {
|
||||||
return absl::UnavailableError("Unable to set parameter");
|
return absl::UnavailableError("Unable to set parameter");
|
||||||
}
|
}
|
||||||
SAPI_ASSIGN_OR_RETURN(
|
SAPI_ASSIGN_OR_RETURN(
|
||||||
iserr, api.ZSTD_CCtx_setParameter(&rcctx, ZSTD_c_checksumFlag, 1));
|
iserr, api.ZSTD_CCtx_setParameter(&rcctx, ZSTD_c_checksumFlag, 1));
|
||||||
if (!iserr) {
|
SAPI_ASSIGN_OR_RETURN(iserr, api.ZSTD_isError(iserr))
|
||||||
|
if (iserr) {
|
||||||
return absl::UnavailableError("Unable to set parameter");
|
return absl::UnavailableError("Unable to set parameter");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user