Skip to content

Commit

Permalink
PDF vector stream parser: correcly parse structures like '[3 3.5] 0 d '
Browse files Browse the repository at this point in the history
The content within the array should be completely ignored
Fixes https://lists.osgeo.org/pipermail/gdal-dev/2024-February/058419.html
  • Loading branch information
rouault authored and github-actions[bot] committed Feb 8, 2024
1 parent e7b3d86 commit 7a9c7ac
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion frmts/pdf/pdfreadvectors.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ static const PDFOperator asPDFOperators[] = {
{"cm", 6},
{"CS", 1},
{"cs", 1},
{"d", 1}, /* we have ignored the first arg */
{"d", 1}, /* we have ignored the first arg which is an array */
// d0
// d1
{"Do", 1},
Expand Down Expand Up @@ -784,6 +784,7 @@ OGRGeometry *PDFDataset::ParseContent(
else if (!bInString && nArrayLevel && ch == ']')
{
nArrayLevel--;
nTokenSize = 0; // completely ignore content in arrays
}

else if (!bInString && nTokenSize == 0 && ch == '(')
Expand Down

0 comments on commit 7a9c7ac

Please sign in to comment.