From ed1c58049f0c164969946b6ad0ff06d952ab1949 Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Tue, 19 Jun 2018 16:23:52 +0000 Subject: Speculative fix for segv destroying CPDF_PageObjectHolder::m_GraphicsMap We speculate that the bug that makes the comparison operator irreflexive might be the cause of the segv on windows production code, should a NaN sneak into the GraphicsData struct. In any event, should this happen, the tree won't be correct with some nodes erroneously replaced. Add a test which fails prior to the patch, but alas does not elicit the segv. Also move operator<() methods to .cpp file corresponding to .h file in which they are delcared. Bug: 852273 Change-Id: Ib7929881e7ffbed8b09f6e2c9fb7898cbde58946 Reviewed-on: https://pdfium-review.googlesource.com/35171 Reviewed-by: dsinclair Commit-Queue: Tom Sepez --- core/fpdfapi/page/cpdf_page.cpp | 14 -------------- 1 file changed, 14 deletions(-) (limited to 'core/fpdfapi/page/cpdf_page.cpp') diff --git a/core/fpdfapi/page/cpdf_page.cpp b/core/fpdfapi/page/cpdf_page.cpp index 4cd58dddaa..7746253564 100644 --- a/core/fpdfapi/page/cpdf_page.cpp +++ b/core/fpdfapi/page/cpdf_page.cpp @@ -219,17 +219,3 @@ int CPDF_Page::GetPageRotation() const { int rotate = pRotate ? (pRotate->GetInteger() / 90) % 4 : 0; return (rotate < 0) ? (rotate + 4) : rotate; } - -bool GraphicsData::operator<(const GraphicsData& other) const { - if (fillAlpha != other.fillAlpha) - return fillAlpha < other.fillAlpha; - if (strokeAlpha != other.strokeAlpha) - return strokeAlpha < other.strokeAlpha; - return blendType < other.blendType; -} - -bool FontData::operator<(const FontData& other) const { - if (baseFont != other.baseFont) - return baseFont < other.baseFont; - return type < other.type; -} -- cgit v1.2.3