From ba387fec25883c72319bf6107eab9e5def453e3e Mon Sep 17 00:00:00 2001 From: buliabyak Date: Thu, 26 Mar 2009 22:58:37 +0000 Subject: [PATCH] sp_lpe_item_has_path_effect now returns false if one of the effects in the stack is invalid or unsupported, in which case LPE stack is disabled --- src/sp-lpe-item.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/sp-lpe-item.cpp b/src/sp-lpe-item.cpp index f1e4c96c2..90e9b2d6d 100644 --- a/src/sp-lpe-item.cpp +++ b/src/sp-lpe-item.cpp @@ -601,7 +601,19 @@ void sp_lpe_item_up_current_path_effect(SPLPEItem *lpeitem) bool sp_lpe_item_has_path_effect(SPLPEItem *lpeitem) { - return !lpeitem->path_effect_list->empty(); + if (lpeitem->path_effect_list->empty()) + return false; + + // go through the list; if some are unknown or invalid, we are not an LPE item! + PathEffectList effect_list = sp_lpe_item_get_effect_list(lpeitem); + for (PathEffectList::iterator it = effect_list.begin(); it != effect_list.end(); it++) + { + LivePathEffectObject *lpeobj = (*it)->lpeobject; + if (!lpeobj || !lpeobj->get_lpe()) + return false; + } + + return true; } bool sp_lpe_item_has_path_effect_recursive(SPLPEItem *lpeitem) -- 2.30.2