summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKai Köhne <kai.koehne@qt.io>2021-11-30 14:49:15 +0100
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2021-12-01 09:26:44 +0000
commit1f5ddb84b8599ed8485a6868d13984b7dc171760 (patch)
tree0faf857c17d134f27383d76d92040f1cda26a2ff
parentb68c89098cef21c617d0ae861440078d63f9c10b (diff)
Fix assert when cloning hidden BMGFill
In case BMGFill is hidden, properties like m_gradient are not initialized - see BMGFill(const QJsonObject &definition ...). If this hidden fill is then cloned, Q_UNREACHABLE is hit. Avoid this by exiting early in this case. Change-Id: I2d7e3121bfeebb5a9730d67d0bf6d45343c9d433 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io> (cherry picked from commit 9f631e12e51104822acdfcccdf8dca8df9ad6ee0) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--src/bodymovin/bmgfill.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/bodymovin/bmgfill.cpp b/src/bodymovin/bmgfill.cpp
index ccd7462..9cfd7d6 100644
--- a/src/bodymovin/bmgfill.cpp
+++ b/src/bodymovin/bmgfill.cpp
@@ -39,6 +39,9 @@ QT_BEGIN_NAMESPACE
BMGFill::BMGFill(const BMGFill &other)
: BMShape(other)
{
+ if (m_hidden)
+ return;
+
m_opacity = other.m_opacity;
m_startPoint = other.m_startPoint;
m_endPoint = other.m_endPoint;