Skip to content
Permalink
Browse files

PDF composer from XML: fix wrong use of SetupVectorGeoreferencing(). …

…Spotted by Coverity CID 1404081, 1404166. Also fixes 1404097 (false positive)
  • Loading branch information...
rouault committed Aug 12, 2019
1 parent d8636b6 commit ba54a1dbc1de680c03c302c7957063c9fb397504
Showing with 6 additions and 6 deletions.
  1. +6 −6 gdal/frmts/pdf/pdfcreatefromcomposition.cpp
@@ -510,7 +510,7 @@ GDALPDFDictionaryRW* GDALPDFComposerWriter::SerializeActions(
}

auto setLayerStateAction = dynamic_cast<SetLayerStateAction*>(poAction.get());
if( setLayerStateAction )
if( poActionDict == nullptr && setLayerStateAction )
{
poActionDict = new GDALPDFDictionaryRW();
poActionDict->Add("Type", GDALPDFObjectRW::CreateName("Action"));
@@ -532,7 +532,7 @@ GDALPDFDictionaryRW* GDALPDFComposerWriter::SerializeActions(
}

auto javascriptAction = dynamic_cast<JavascriptAction*>(poAction.get());
if( javascriptAction )
if( poActionDict == nullptr && javascriptAction )
{
poActionDict = new GDALPDFDictionaryRW();
poActionDict->Add("Type", GDALPDFObjectRW::CreateName("Action"));
@@ -1779,8 +1779,8 @@ bool GDALPDFComposerWriter::WriteVector(const CPLXMLNode* psNode,
if( pszGeoreferencingId &&
!SetupVectorGeoreferencing(pszGeoreferencingId,
poLayer, oPageContext,
dfClippingMinX, dfClippingMaxX,
dfClippingMinY, dfClippingMaxY,
dfClippingMinX, dfClippingMinY,
dfClippingMaxX, dfClippingMaxY,
adfMatrix, poCT) )
{
return false;
@@ -2030,8 +2030,8 @@ bool GDALPDFComposerWriter::WriteVectorLabel(const CPLXMLNode* psNode,
if( pszGeoreferencingId &&
!SetupVectorGeoreferencing(pszGeoreferencingId,
poLayer, oPageContext,
dfClippingMinX, dfClippingMaxX,
dfClippingMinY, dfClippingMaxY,
dfClippingMinX, dfClippingMinY,
dfClippingMaxX, dfClippingMaxY,
adfMatrix, poCT) )
{
return false;

0 comments on commit ba54a1d

Please sign in to comment.
You can’t perform that action at this time.