Changeset 239833 in webkit
- Timestamp:
- Jan 10, 2019, 10:08:23 AM (8 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
-
ChangeLog (modified) (1 diff)
-
platform/graphics/ca/GraphicsLayerCA.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r239831 r239833 1 2019-01-09 Dean Jackson <dino@apple.com> 2 3 Safari Crashing in Version 12.0.1 (14606.2.104.1.1) WebCore::GraphicsLayerCA::updateBackdropFilters 4 https://bugs.webkit.org/show_bug.cgi?id=193309 5 <rdar://problem/45279224> 6 7 Reviewed by Antoine Quint. 8 9 A speculative fix for a CheckedArithmetic crash triggered in updateBackdropFilters. 10 11 The crash log indicates we crash in a Checked<> class that is not recording 12 overflow i.e. it is crashing due to an overflow. The only place in this function 13 where that could happen is when we convert the FloatRect for the backdrop 14 region into a Checked<unsigned> for width and height. This suggests that either 15 the width or height are negative, or the float values are too large for integers, 16 or the product of the two overflows. 17 18 Avoid this by using RecordOverflow, but also changing the code a little to 19 bail if the rectangle is incorrect. 20 21 * platform/graphics/ca/GraphicsLayerCA.cpp: 22 (WebCore::GraphicsLayerCA::updateBackdropFilters): 23 1 24 2019-01-10 Oriol Brufau <obrufau@igalia.com> 2 25 -
trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp
r239461 r239833 2148 2148 void GraphicsLayerCA::updateBackdropFilters(CommitState& commitState) 2149 2149 { 2150 using CheckedUnsigned = Checked<unsigned, RecordOverflow>; 2151 2150 2152 bool canHaveBackdropFilters = needsBackdrop(); 2151 2153 2152 2154 if (canHaveBackdropFilters) { 2153 Checked<unsigned, RecordOverflow> backdropFilterArea = Checked<unsigned>(static_cast<int>(m_backdropFiltersRect.rect().width())) * Checked<unsigned>(static_cast<int>(m_backdropFiltersRect.rect().height())); 2154 if (backdropFilterArea.hasOverflowed()) 2155 canHaveBackdropFilters = false; 2156 else { 2157 Checked<unsigned, RecordOverflow> newTotalBackdropFilterArea = Checked<unsigned, RecordOverflow>(commitState.totalBackdropFilterArea) + backdropFilterArea; 2158 if (newTotalBackdropFilterArea.hasOverflowed() || newTotalBackdropFilterArea.unsafeGet() > cMaxTotalBackdropFilterArea) 2159 canHaveBackdropFilters = false; 2160 else 2161 commitState.totalBackdropFilterArea = newTotalBackdropFilterArea.unsafeGet(); 2155 canHaveBackdropFilters = false; 2156 IntRect backdropFilterRect = enclosingIntRect(m_backdropFiltersRect.rect()); 2157 if (backdropFilterRect.width() > 0 && backdropFilterRect.height() > 0) { 2158 CheckedUnsigned backdropFilterArea = CheckedUnsigned(backdropFilterRect.width()) * CheckedUnsigned(backdropFilterRect.height()); 2159 if (!backdropFilterArea.hasOverflowed()) { 2160 CheckedUnsigned newTotalBackdropFilterArea = CheckedUnsigned(commitState.totalBackdropFilterArea) + backdropFilterArea; 2161 if (!newTotalBackdropFilterArea.hasOverflowed() && newTotalBackdropFilterArea.unsafeGet() <= cMaxTotalBackdropFilterArea) { 2162 commitState.totalBackdropFilterArea = newTotalBackdropFilterArea.unsafeGet(); 2163 canHaveBackdropFilters = true; 2164 } 2165 } 2162 2166 } 2163 2167 }
Note:
See TracChangeset
for help on using the changeset viewer.