emfio/source/reader/emfreader.cxx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
New commits: commit a9c14a3b2c1d14373b63cf0aff0eb92ab5d640d8 Author: Caolán McNamara <[email protected]> AuthorDate: Fri May 12 16:08:12 2023 +0100 Commit: Caolán McNamara <[email protected]> CommitDate: Fri May 12 19:30:27 2023 +0200 Related: ofz#58830 do Bezier point count check Change-Id: I1a7d7600563b57fb6dd9479b288d6fd3d4483059 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151710 Tested-by: Jenkins Reviewed-by: Caolán McNamara <[email protected]> diff --git a/emfio/source/reader/emfreader.cxx b/emfio/source/reader/emfreader.cxx index 2a5daa7a6891..ceb797f568b0 100644 --- a/emfio/source/reader/emfreader.cxx +++ b/emfio/source/reader/emfreader.cxx @@ -967,6 +967,10 @@ namespace emfio unsigned char nPointType(0); mpInputStream->ReadUChar(nPointType); aPointTypes.push_back(nPointType); + } + nPointsCount = std::min(aPoints.size(), aPointTypes.size()); + for (sal_uInt32 i = 0; i < nPointsCount; i++) + { SAL_INFO_IF(aPointTypes[i] == PT_MOVETO, "emfio", "\t\t" << i << "/" << nPointsCount - 1 << " PT_MOVETO, " << aPoints[i].getX() << ", " << aPoints[i].getY()); @@ -980,7 +984,7 @@ namespace emfio "\t\t" << i << "/" << nPointsCount - 1 << " PT_BEZIERTO, " << aPoints[i].getX() << ", " << aPoints[i].getY()); - if ((aPointTypes[i] != PT_MOVETO) && (nPointType & PT_BEZIERTO)) + if ((aPointTypes[i] != PT_MOVETO) && (aPointTypes[i] & PT_BEZIERTO)) nBezierCount++; else if (nBezierCount % 3 == 0) nBezierCount = 0; @@ -993,7 +997,6 @@ namespace emfio } } if (wrongFile) break; - nPointsCount = std::min(aPoints.size(), aPointTypes.size()); for (sal_uInt32 i = 0; i < nPointsCount; i++) { if (aPointTypes[i] == PT_MOVETO)
