From ee6de4b5fac0ab2adbb7789c16acef8e35062f7b Mon Sep 17 00:00:00 2001 From: Florin Malita Date: Sun, 21 Jan 2018 11:13:17 -0500 Subject: [skottie] Only apply effects to non-empty geometry stacks TBR= Change-Id: Iaafd63c787b72cdf83b21bd39cc10d01612e435d Reviewed-on: https://skia-review.googlesource.com/97662 Reviewed-by: Florin Malita Commit-Queue: Florin Malita --- experimental/skottie/Skottie.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'experimental') diff --git a/experimental/skottie/Skottie.cpp b/experimental/skottie/Skottie.cpp index 696f619f83..7a08cec9df 100644 --- a/experimental/skottie/Skottie.cpp +++ b/experimental/skottie/Skottie.cpp @@ -628,9 +628,11 @@ sk_sp AttachShape(const Json::Value& jshape, AttachContext* ct case ShapeType::kGeometryEffect: { // Apply the current effect and pop from the stack. SkASSERT(rec->fInfo.fAttacherIndex < SK_ARRAY_COUNT(gGeometryEffectAttachers)); - geos = gGeometryEffectAttachers[rec->fInfo.fAttacherIndex](rec->fJson, - ctx, - std::move(geos)); + if (!geos.empty()) { + geos = gGeometryEffectAttachers[rec->fInfo.fAttacherIndex](rec->fJson, + ctx, + std::move(geos)); + } SkASSERT(geometryEffectStack->back().fJson == rec->fJson); SkASSERT(geometryEffectStack->back().fAttach == -- cgit v1.2.3