Skip to content

Commit

Permalink
Fix a few Coverity Scan warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
rouault committed May 19, 2024
1 parent 9c82612 commit c219555
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
4 changes: 2 additions & 2 deletions frmts/tiledb/tiledbdense.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ CPLErr TileDBRasterBand::IRasterIO(GDALRWFlag eRWFlag, int nXOff, int nYOff,

if (eBufType == eDataType && nXSize == nBufXSize && nYSize == nBufYSize &&
nBufferDTSize > 0 && nPixelSpace == nBufferDTSize &&
nLineSpace == nBufXSize * nBufferDTSize)
nLineSpace == nBufXSize * nPixelSpace)
{
const uint64_t nBandIdx = poGDS->nBandStart + nBand - 1;
std::vector<uint64_t> oaSubarray = {
Expand Down Expand Up @@ -668,7 +668,7 @@ CPLErr TileDBRasterDataset::IRasterIO(
if (eIndexMode == ATTRIBUTES && nBandCount == nBands &&
eBufType == eDataType && nXSize == nBufXSize && nYSize == nBufYSize &&
nBufferDTSize > 0 && nPixelSpace == nBufferDTSize &&
nLineSpace == nBufXSize * nBufferDTSize &&
nLineSpace == nBufXSize * nPixelSpace &&
((nBandSpace == 0 && nBandCount == 1) ||
nBandSpace == nBufYSize * nLineSpace))
{
Expand Down
3 changes: 2 additions & 1 deletion port/cpl_vsil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1464,7 +1464,8 @@ int VSIFilesystemHandler::CopyFile(const char *pszSource, const char *pszTarget,
nSourceSize != static_cast<vsi_l_offset>(-1)
? double(nOffset) / nSourceSize
: 0.0,
pszSource ? osMsg.c_str() : nullptr, pProgressData))
!osMsg.empty() ? osMsg.c_str() : nullptr,
pProgressData))
{
ret = -1;
break;
Expand Down
6 changes: 4 additions & 2 deletions port/cpl_vsil_s3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4117,9 +4117,11 @@ int IVSIS3LikeFSHandler::CopyFileRestartable(
else
{
if (pProgressFunc &&
!pProgressFunc(double(iCurChunk) / nChunkCount,
osMsg.c_str(), pProgressData))
!pProgressFunc(double(iChunk) / nChunkCount, osMsg.c_str(),
pProgressData))
{
// Lock taken only to make static analyzer happy...
std::lock_guard oLock(oMutex);
bSuccess = false;
break;
}
Expand Down

0 comments on commit c219555

Please sign in to comment.