diff options
author | Konstantin Tokarev <annulen@yandex.ru> | 2018-01-06 22:33:43 +0300 |
---|---|---|
committer | Konstantin Tokarev <annulen@yandex.ru> | 2018-01-07 22:38:56 +0000 |
commit | 9aeb4c9fef3c0de0f2fdece6d4adcbf1abf188f2 (patch) | |
tree | 193724e6c2b44bf34b65b701a5fddc6352c0838d | |
parent | 7fc978176a985acd992a905be7f09a5bf99173d3 (diff) | |
download | qtwebkit-9aeb4c9fef3c0de0f2fdece6d4adcbf1abf188f2.tar.gz |
REGRESSION(f45e84c4): Crash on npmjs.com
GraphicsContext::endPlatformTransparencyLayer() crashes when called from
destructor if alpha mask layers are at the bottom of layers stack.
While this looks like a violation of endPlatformTransparencyLayer's
premise that there should be at least on opacity layer remaining, I don't
see a better way to avoid code duplication without massive refactoring.
Also fixes crash in svg/clip-path/mask-nested-clip-path-010-expected.svg
Change-Id: I5c8cfc2f447c6a0fc6f37d5792375fa123761928
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 201c7117463e43e9cbd02ff33c6f491d81b2e6c7)
-rw-r--r-- | Source/WebCore/platform/graphics/qt/GraphicsContextQt.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Source/WebCore/platform/graphics/qt/GraphicsContextQt.cpp b/Source/WebCore/platform/graphics/qt/GraphicsContextQt.cpp index b11e05d8b..c9595a118 100644 --- a/Source/WebCore/platform/graphics/qt/GraphicsContextQt.cpp +++ b/Source/WebCore/platform/graphics/qt/GraphicsContextQt.cpp @@ -1308,6 +1308,8 @@ void GraphicsContext::endPlatformTransparencyLayer() while ( ! m_data->layers.top()->alphaMask.isNull() ){ --m_data->layers.top()->saveCounter; popTransparencyLayerInternal(); + if (m_data->layers.isEmpty()) + return; } TransparencyLayer* layer = m_data->layers.pop(); --m_data->layerCount; // see the comment for layerCount |