Skip to content

Commit

Permalink
Fix Coverity warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
rouault committed Jan 8, 2025
1 parent 9581c77 commit 196f855
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
4 changes: 2 additions & 2 deletions apps/gdalalg_abstract_pipeline.h
Original file line number Diff line number Diff line change
Expand Up @@ -218,14 +218,14 @@ template <class StepAlgorithm>
std::string GDALAbstractPipelineAlgorithm<StepAlgorithm>::GetUsageAsJSON() const
{
CPLJSONDocument oDoc;
oDoc.LoadMemory(GDALAlgorithm::GetUsageAsJSON());
CPL_IGNORE_RET_VAL(oDoc.LoadMemory(GDALAlgorithm::GetUsageAsJSON()));

CPLJSONArray jPipelineSteps;
for (const std::string &name : m_stepRegistry.GetNames())
{
auto alg = GetStepAlg(name);
CPLJSONDocument oStepDoc;
oStepDoc.LoadMemory(alg->GetUsageAsJSON());
CPL_IGNORE_RET_VAL(oStepDoc.LoadMemory(alg->GetUsageAsJSON()));
jPipelineSteps.Add(oStepDoc.GetRoot());
}
oDoc.GetRoot().Add("pipeline_algorithms", jPipelineSteps);
Expand Down
11 changes: 3 additions & 8 deletions frmts/libertiff/libertiffdataset.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,16 +58,11 @@ struct LIBERTIFFDatasetFileReader final : public LIBERTIFF_NS::FileReader

uint64_t size() const override
{
// coverity[missing_lock,lock_evasion]
std::lock_guard oLock(m_oMutex);
if (m_nFileSize == 0)
{
std::lock_guard oLock(m_oMutex);
// cppcheck-suppress identicalInnerCondition
if (m_nFileSize == 0)
{
m_fp->Seek(0, SEEK_END);
m_nFileSize = m_fp->Tell();
}
m_fp->Seek(0, SEEK_END);
m_nFileSize = m_fp->Tell();
}
return m_nFileSize;
}
Expand Down

0 comments on commit 196f855

Please sign in to comment.