diff --git a/autotest/gdrivers/pdf.py b/autotest/gdrivers/pdf.py index 7db4786de764..283f9507a7ed 100755 --- a/autotest/gdrivers/pdf.py +++ b/autotest/gdrivers/pdf.py @@ -374,12 +374,14 @@ def test_pdf_ogcbp(poppler_or_pdfium_or_podofo): tst = gdaltest.GDALTest( "PDF", "byte.tif", 1, None, options=["GEO_ENCODING=OGC_BP"] ) + gdal.ErrorReset() tst.testCreateCopy( check_minmax=0, check_gt=1, check_srs=True, check_checksum_not_null=pdf_checksum_available(), ) + assert gdal.GetLastErrorMsg() == "" ############################################################################### diff --git a/frmts/pdf/pdfdataset.cpp b/frmts/pdf/pdfdataset.cpp index 845057fd68a9..721681643fbb 100644 --- a/frmts/pdf/pdfdataset.cpp +++ b/frmts/pdf/pdfdataset.cpp @@ -5951,6 +5951,7 @@ int PDFDataset::ParseLGIDictDictFirstPass(GDALPDFDictionary *poLGIDict, poRing->addPoint(dfX, dfY); } } + poRing->closeRings(); m_poNeatLine->addRingDirectly(poRing); }