Skip to content

Commit

Permalink
Fix Coverity warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
rouault committed Sep 1, 2024
1 parent 7df20d4 commit 8a3cef5
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
6 changes: 3 additions & 3 deletions frmts/pdf/pdfdataset.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1567,7 +1567,7 @@ class GDALPDFiumRenderDeviceDriver : public RenderDeviceDriverIface
virtual bool GetDIBits(RetainPtr<CFX_DIBitmap> bitmap, int left,
int top) const override
{
return m_poParent->GetDIBits(bitmap, left, top);
return m_poParent->GetDIBits(std::move(bitmap), left, top);
}

virtual RetainPtr<const CFX_DIBitmap> GetBackDrop() const override
Expand Down Expand Up @@ -1675,8 +1675,8 @@ class GDALPDFiumRenderDeviceDriver : public RenderDeviceDriverIface
{
if (!bEnableBitmap && !bTemporaryEnableVectorForTextStroking)
return true;
return m_poParent->SetBitsWithMask(bitmap, mask, left, top, alpha,
blend_type);
return m_poParent->SetBitsWithMask(std::move(bitmap), std::move(mask),
left, top, alpha, blend_type);
}

virtual void SetGroupKnockout(bool group_knockout) override
Expand Down
15 changes: 9 additions & 6 deletions ogr/ogrsf_frmts/sqlite/ogrsqlitedatasource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -202,12 +202,15 @@ void OGRSQLiteBaseDataSource::FinishSpatialite()
{
if (hSpatialiteCtxt != nullptr)
{
// Current implementation of spatialite_cleanup_ex() (as of libspatialite 5.1)
// is not re-entrant due to the use of xmlCleanupParser()
// Cf https://groups.google.com/g/spatialite-users/c/tsfZ_GDrRKs/m/aj-Dt4xoBQAJ?utm_medium=email&utm_source=footer
static std::mutex oCleanupMutex;
std::lock_guard oLock(oCleanupMutex);
pfn_spatialite_cleanup_ex(hSpatialiteCtxt);
auto ctxt = hSpatialiteCtxt;
{
// Current implementation of spatialite_cleanup_ex() (as of libspatialite 5.1)
// is not re-entrant due to the use of xmlCleanupParser()
// Cf https://groups.google.com/g/spatialite-users/c/tsfZ_GDrRKs/m/aj-Dt4xoBQAJ?utm_medium=email&utm_source=footer
static std::mutex oCleanupMutex;
std::lock_guard oLock(oCleanupMutex);
pfn_spatialite_cleanup_ex(ctxt);
}
hSpatialiteCtxt = nullptr;
}
}
Expand Down

0 comments on commit 8a3cef5

Please sign in to comment.