Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2304)

Unified Diff: Source/platform/transforms/PerspectiveTransformOperation.cpp

Issue 1027513003: Avoid uninitialized memory when decomposing a matrix fails. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | Source/platform/transforms/RotateTransformOperation.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/transforms/PerspectiveTransformOperation.cpp
diff --git a/Source/platform/transforms/PerspectiveTransformOperation.cpp b/Source/platform/transforms/PerspectiveTransformOperation.cpp
index 7149758afea29c686ca9dc1de2912bf2f34644bf..b9bf5f5133cb7f4b8a9bd1588f2f8b699c7c3a41 100644
--- a/Source/platform/transforms/PerspectiveTransformOperation.cpp
+++ b/Source/platform/transforms/PerspectiveTransformOperation.cpp
@@ -48,8 +48,13 @@ PassRefPtr<TransformOperation> PerspectiveTransformOperation::blend(const Transf
fromT.applyPerspective(fromOp ? fromOp->m_p : 0);
toT.applyPerspective(m_p);
toT.blend(fromT, progress);
+
TransformationMatrix::DecomposedType decomp;
- toT.decompose(decomp);
+ if (!toT.decompose(decomp)) {
+ // If we can't decompose, bail out of interpolation.
+ const PerspectiveTransformOperation* usedOperation = progress > 0.5 ? this : fromOp;
+ return PerspectiveTransformOperation::create(usedOperation->perspective());
+ }
if (decomp.perspectiveZ) {
double val = -1.0 / decomp.perspectiveZ;
« no previous file with comments | « no previous file | Source/platform/transforms/RotateTransformOperation.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698