summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/fpdfapi/page/cpdf_streamcontentparser.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/core/fpdfapi/page/cpdf_streamcontentparser.cpp b/core/fpdfapi/page/cpdf_streamcontentparser.cpp
index 798b9d4f4e..d8b176b288 100644
--- a/core/fpdfapi/page/cpdf_streamcontentparser.cpp
+++ b/core/fpdfapi/page/cpdf_streamcontentparser.cpp
@@ -1440,6 +1440,15 @@ void CPDF_StreamContentParser::AddPathPoint(float x,
float y,
FXPT_TYPE type,
bool close) {
+ // If the path point is the same move as the previous one and neither of them
+ // closes the path, then just skip it.
+ if (!close && type == FXPT_TYPE::MoveTo && m_PathPointCount &&
+ !m_pPathPoints[m_PathPointCount - 1].m_CloseFigure &&
+ m_pPathPoints[m_PathPointCount - 1].m_Type == type &&
+ m_PathCurrentX == x && m_PathCurrentY == y) {
+ return;
+ }
+
m_PathCurrentX = x;
m_PathCurrentY = y;
if (type == FXPT_TYPE::MoveTo && !close) {