Skip to content

Commit 8e39cf9

Browse files
committed
Fix Coverity Scan warnings
1 parent a8f0531 commit 8e39cf9

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

apps/gdalalg_raster_neighbors.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,8 @@ bool GDALRasterNeighborsAlgorithm::RunStep(GDALPipelineStepRunContext &)
451451
def.size = m_size;
452452
const double dfWeight =
453453
m_method[i] == "mean"
454-
? 1.0 / (static_cast<double>(m_size) * m_size)
454+
? 1.0 / (static_cast<double>(m_size) * m_size +
455+
std::numeric_limits<double>::min())
455456
: 1.0;
456457
def.adfCoefficients.resize(static_cast<size_t>(m_size) * m_size,
457458
dfWeight);

gcore/gdalalgorithm.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4611,7 +4611,7 @@ void GDALAlgorithm::SetAutoCompleteFunctionForFieldName(
46114611
GDAL_OF_VECTOR | GDAL_OF_READONLY));
46124612
if (poDS)
46134613
{
4614-
const auto layerName = layerNameArg.Get<std::string>();
4614+
const auto &layerName = layerNameArg.Get<std::string>();
46154615
if (layerName.empty())
46164616
{
46174617
// Loop through all layers

0 commit comments

Comments
 (0)