[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 <fmalita@chromium.org>
Commit-Queue: Florin Malita <fmalita@chromium.org>
diff --git a/experimental/skottie/Skottie.cpp b/experimental/skottie/Skottie.cpp
index 696f619..7a08cec 100644
--- a/experimental/skottie/Skottie.cpp
+++ b/experimental/skottie/Skottie.cpp
@@ -628,9 +628,11 @@
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 ==