Changeset 240061 in webkit
- Timestamp:
- Jan 16, 2019, 3:27:09 PM (8 years ago)
- Location:
- branches/safari-607-branch/Source/WebCore
- Files:
-
- 2 edited
-
ChangeLog (modified) (1 diff)
-
platform/graphics/ca/GraphicsLayerCA.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/safari-607-branch/Source/WebCore/ChangeLog
r240058 r240061 1 2019-01-15 Alan Coon <alancoon@apple.com> 2 3 Cherry-pick r239833. rdar://problem/47260274 4 5 Safari Crashing in Version 12.0.1 (14606.2.104.1.1) WebCore::GraphicsLayerCA::updateBackdropFilters 6 https://bugs.webkit.org/show_bug.cgi?id=193309 7 <rdar://problem/45279224> 8 9 Reviewed by Antoine Quint. 10 11 A speculative fix for a CheckedArithmetic crash triggered in updateBackdropFilters. 12 13 The crash log indicates we crash in a Checked<> class that is not recording 14 overflow i.e. it is crashing due to an overflow. The only place in this function 15 where that could happen is when we convert the FloatRect for the backdrop 16 region into a Checked<unsigned> for width and height. This suggests that either 17 the width or height are negative, or the float values are too large for integers, 18 or the product of the two overflows. 19 20 Avoid this by using RecordOverflow, but also changing the code a little to 21 bail if the rectangle is incorrect. 22 23 * platform/graphics/ca/GraphicsLayerCA.cpp: 24 (WebCore::GraphicsLayerCA::updateBackdropFilters): 25 26 git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239833 268f45cc-cd09-0410-ab3c-d52691b4dbfc 27 28 2019-01-09 Dean Jackson <dino@apple.com> 29 30 Safari Crashing in Version 12.0.1 (14606.2.104.1.1) WebCore::GraphicsLayerCA::updateBackdropFilters 31 https://bugs.webkit.org/show_bug.cgi?id=193309 32 <rdar://problem/45279224> 33 34 Reviewed by Antoine Quint. 35 36 A speculative fix for a CheckedArithmetic crash triggered in updateBackdropFilters. 37 38 The crash log indicates we crash in a Checked<> class that is not recording 39 overflow i.e. it is crashing due to an overflow. The only place in this function 40 where that could happen is when we convert the FloatRect for the backdrop 41 region into a Checked<unsigned> for width and height. This suggests that either 42 the width or height are negative, or the float values are too large for integers, 43 or the product of the two overflows. 44 45 Avoid this by using RecordOverflow, but also changing the code a little to 46 bail if the rectangle is incorrect. 47 48 * platform/graphics/ca/GraphicsLayerCA.cpp: 49 (WebCore::GraphicsLayerCA::updateBackdropFilters): 50 1 51 2019-01-15 Alan Coon <alancoon@apple.com> 2 52 -
branches/safari-607-branch/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp
r239461 r240061 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.