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

checks: Fix code scanning CodeQL overflow warnings #2168

Merged
merged 2 commits into from Feb 14, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/ogsf/gs3.c
Expand Up @@ -1156,7 +1156,7 @@ int Gs_update_attrange(geosurf * gs, int desc)
return (-1);
}

size = gs->rows * gs->cols;
size = (long)gs->rows * gs->cols;
nilason marked this conversation as resolved.
Show resolved Hide resolved
p = (char *)tb->cb;
SET_MINMAX(p, nm, size, min, max);
}
Expand Down
4 changes: 2 additions & 2 deletions raster3d/r3.in.v5d/v5d.c
Expand Up @@ -2112,7 +2112,7 @@ int v5dReadGrid(v5dstruct * v, int time, int var, float data[])
bytes = v->Nr * v->Nc * v->Nl[var] * sizeof(unsigned char);
}
else if (v->CompressMode == 2) {
bytes = v->Nr * v->Nc * v->Nl[var] * sizeof(unsigned short);
bytes = v->Nr * v->Nc * v->Nl[var] * (int)sizeof(unsigned short);
}
else if (v->CompressMode == 4) {
bytes = v->Nr * v->Nc * v->Nl[var] * sizeof(float);
Expand Down Expand Up @@ -2511,7 +2511,7 @@ int v5dWriteGrid(v5dstruct * v, int time, int var, const float data[])
bytes = v->Nr * v->Nc * v->Nl[var] * sizeof(unsigned char);
}
else if (v->CompressMode == 2) {
bytes = v->Nr * v->Nc * v->Nl[var] * sizeof(unsigned short);
bytes = v->Nr * v->Nc * v->Nl[var] * (int)sizeof(unsigned short);
}
else if (v->CompressMode == 4) {
bytes = v->Nr * v->Nc * v->Nl[var] * sizeof(float);
Expand Down
4 changes: 2 additions & 2 deletions raster3d/r3.out.v5d/v5d.c
Expand Up @@ -2112,7 +2112,7 @@ int v5dReadGrid(v5dstruct * v, int time, int var, float data[])
bytes = v->Nr * v->Nc * v->Nl[var] * sizeof(unsigned char);
}
else if (v->CompressMode == 2) {
bytes = v->Nr * v->Nc * v->Nl[var] * sizeof(unsigned short);
bytes = v->Nr * v->Nc * v->Nl[var] * (int)sizeof(unsigned short);
}
else if (v->CompressMode == 4) {
bytes = v->Nr * v->Nc * v->Nl[var] * sizeof(float);
Expand Down Expand Up @@ -2513,7 +2513,7 @@ int v5dWriteGrid(v5dstruct * v, int time, int var, const float data[])
bytes = v->Nr * v->Nc * v->Nl[var] * sizeof(unsigned char);
}
else if (v->CompressMode == 2) {
bytes = v->Nr * v->Nc * v->Nl[var] * sizeof(unsigned short);
bytes = v->Nr * v->Nc * v->Nl[var] * (int)sizeof(unsigned short);
}
else if (v->CompressMode == 4) {
bytes = v->Nr * v->Nc * v->Nl[var] * sizeof(float);
Expand Down