diff options
author | Caolán McNamara <caolanm@redhat.com> | 2023-05-12 16:08:12 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2023-05-12 19:30:27 +0200 |
commit | a9c14a3b2c1d14373b63cf0aff0eb92ab5d640d8 (patch) | |
tree | 6c84d951c6dd7f53bfe1474cf89920cf0d9db0d0 | |
parent | 976cd8c1c146d6a733a53ac6a55aad84b9bbd406 (diff) |
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 <caolanm@redhat.com>
-rw-r--r-- | emfio/source/reader/emfreader.cxx | 7 |
1 files changed, 5 insertions, 2 deletions
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) |