Title: [282527] releases/WebKitGTK/webkit-2.32/Source/WebCore
- Revision
- 282527
- Author
- [email protected]
- Date
- 2021-09-16 03:09:24 -0700 (Thu, 16 Sep 2021)
Log Message
Merge r277854 - Detect invalid InlinePathData in FillInlinePath
https://bugs.webkit.org/show_bug.cgi?id=225693
Patch by Rob Buis <[email protected]> on 2021-05-21
Reviewed by Ryosuke Niwa.
Detect invalid InlinePathData in FillInlinePath.
* platform/graphics/displaylists/DisplayListItems.h:
(WebCore::DisplayList::InlinePathDataStorage::InlinePathDataStorage):
(WebCore::DisplayList::InlinePathDataStorage::isValid const):
(WebCore::DisplayList::FillInlinePath::FillInlinePath):
(WebCore::DisplayList::FillInlinePath::path const): Deleted.
Modified Paths
Diff
Modified: releases/WebKitGTK/webkit-2.32/Source/WebCore/ChangeLog (282526 => 282527)
--- releases/WebKitGTK/webkit-2.32/Source/WebCore/ChangeLog 2021-09-16 10:09:16 UTC (rev 282526)
+++ releases/WebKitGTK/webkit-2.32/Source/WebCore/ChangeLog 2021-09-16 10:09:24 UTC (rev 282527)
@@ -1,3 +1,18 @@
+2021-05-21 Rob Buis <[email protected]>
+
+ Detect invalid InlinePathData in FillInlinePath
+ https://bugs.webkit.org/show_bug.cgi?id=225693
+
+ Reviewed by Ryosuke Niwa.
+
+ Detect invalid InlinePathData in FillInlinePath.
+
+ * platform/graphics/displaylists/DisplayListItems.h:
+ (WebCore::DisplayList::InlinePathDataStorage::InlinePathDataStorage):
+ (WebCore::DisplayList::InlinePathDataStorage::isValid const):
+ (WebCore::DisplayList::FillInlinePath::FillInlinePath):
+ (WebCore::DisplayList::FillInlinePath::path const): Deleted.
+
2021-05-20 Chris Dumez <[email protected]>
WebAudioBufferList::setSampleCount() should early return if computeBufferSizes() fails
Modified: releases/WebKitGTK/webkit-2.32/Source/WebCore/platform/graphics/displaylists/DisplayListItems.h (282526 => 282527)
--- releases/WebKitGTK/webkit-2.32/Source/WebCore/platform/graphics/displaylists/DisplayListItems.h 2021-09-16 10:09:16 UTC (rev 282526)
+++ releases/WebKitGTK/webkit-2.32/Source/WebCore/platform/graphics/displaylists/DisplayListItems.h 2021-09-16 10:09:24 UTC (rev 282527)
@@ -1809,26 +1809,45 @@
#if ENABLE(INLINE_PATH_DATA)
-class FillInlinePath {
+class InlinePathDataStorage {
public:
+ InlinePathDataStorage(const InlinePathData& pathData)
+ {
+ if (pathData.index() >= 0 && static_cast<size_t>(pathData.index()) < WTF::variant_size<InlinePathData>::value)
+ m_pathData = pathData;
+ else {
+ auto moved = WTFMove(m_pathData);
+ UNUSED_VARIABLE(moved);
+ }
+ }
+
+ bool isValid() const { return !m_pathData.valueless_by_exception(); }
+
+ Path path() const { return Path::from(m_pathData); }
+
+protected:
+ InlinePathData m_pathData;
+};
+
+class FillInlinePath : public InlinePathDataStorage {
+public:
static constexpr ItemType itemType = ItemType::FillInlinePath;
static constexpr bool isInlineItem = true;
static constexpr bool isDrawingItem = true;
+ FillInlinePath(const FillInlinePath& other)
+ : InlinePathDataStorage(other.m_pathData)
+ {
+ }
FillInlinePath(const InlinePathData& pathData)
- : m_pathData(pathData)
+ : InlinePathDataStorage(pathData)
{
}
- Path path() const { return Path::from(m_pathData); }
-
void apply(GraphicsContext&) const;
Optional<FloatRect> globalBounds() const { return WTF::nullopt; }
Optional<FloatRect> localBounds(const GraphicsContext&) const { return path().fastBoundingRect(); }
-
-private:
- InlinePathData m_pathData;
};
#endif // ENABLE(INLINE_PATH_DATA)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes