From a9d5505592f530cc853dfee1f74b226ed2ee1f89 Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Sun, 12 Jan 2025 23:11:56 +0100 Subject: [PATCH] VRT: silence Coverity false positive (CID 1589208, 1589104, 1589098) --- frmts/vrt/pixelfunctions.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/frmts/vrt/pixelfunctions.cpp b/frmts/vrt/pixelfunctions.cpp index e7a4bc519b65..72e028719691 100644 --- a/frmts/vrt/pixelfunctions.cpp +++ b/frmts/vrt/pixelfunctions.cpp @@ -766,6 +766,7 @@ static CPLErr DivPixelFunc(void **papoSources, int nSources, void *pData, for (int iCol = 0; iCol < nXSize; ++iCol, ++ii) { const double dfVal = GetSrcVal(papoSources[1], eSrcType, ii); + // coverity[divide_by_zero] double dfPixVal = dfVal == 0 ? std::numeric_limits::infinity() @@ -914,6 +915,7 @@ static CPLErr InvPixelFunc(void **papoSources, int nSources, void *pData, // Source raster pixels may be obtained with GetSrcVal macro. // Not complex. const double dfVal = GetSrcVal(papoSources[0], eSrcType, ii); + // coverity[divide_by_zero] const double dfPixVal = dfVal == 0 ? std::numeric_limits::infinity() : dfK / dfVal; @@ -1482,6 +1484,7 @@ static CPLErr NormDiffPixelFunc(void **papoSources, int nSources, void *pData, const double dfDenom = (dfLeftVal + dfRightVal); + // coverity[divide_by_zero] const double dfPixVal = dfDenom == 0 ? std::numeric_limits::infinity() : (dfLeftVal - dfRightVal) / dfDenom;