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

Properly treat byte count vs. number of floats #6

Merged
merged 1 commit into from
Oct 19, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions core/accelogic/src/ZipAccelogic.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ void R__zipBLAST(int cxlevel, int *srcsize, char *src, int *tgtsize, char *tgt,
size_t out_size;

if (cxlevel < 71 && (*srcsize % 4 == 0)) {
int float_size = *srcsize / 4;
size_t float_size = *srcsize / 4;
// Use "absSense". We shift the request config from [1,71] to [-60, 10]
auto absSensLevel = cxlevel - 61;
// Note: We need to check the source really start of a float boundary.
Expand Down Expand Up @@ -79,7 +79,8 @@ void R__unzipBLAST(int *srcsize, unsigned char *src, int *tgtsize, unsigned char
auto absSensLevel = cxlevel - 61;
// Note: We need to check the destination really start of a float boundary.
float *staging = nullptr;
size_t out_size = blast1_decompress<true>(absSensLevel, (char*)(&src[kHeaderSize]), *srcsize, staging);
size_t float_size = blast1_decompress<true>(absSensLevel, (char*)(&src[kHeaderSize]), *srcsize, staging);
size_t out_size = float_size * 4;
// Note: We need to upgrade blast to avoid the memcpy
if ( out_size > (size_t)*tgtsize ) {
delete [] staging;
Expand Down