From eaa4d07c611d5487e79d94b037465d490bfded5b Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Wed, 18 Dec 2024 11:45:43 -0800 Subject: [PATCH 1/3] #3301 Don't crash on invalid visual parameter update. (#3303) --- indra/llappearance/llwearable.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/indra/llappearance/llwearable.cpp b/indra/llappearance/llwearable.cpp index a7e5292fed..f30c147b91 100644 --- a/indra/llappearance/llwearable.cpp +++ b/indra/llappearance/llwearable.cpp @@ -652,7 +652,7 @@ void LLWearable::setVisualParamWeight(S32 param_index, F32 value) } else { - LL_ERRS() << "LLWearable::setVisualParam passed invalid parameter index: " << param_index << " for wearable type: " << this->getName() << LL_ENDL; + LL_WARNS() << "LLWearable::setVisualParam passed invalid parameter index: " << param_index << " for wearable type: " << this->getName() << LL_ENDL; } } @@ -665,7 +665,7 @@ F32 LLWearable::getVisualParamWeight(S32 param_index) const } else { - LL_WARNS() << "LLWerable::getVisualParam passed invalid parameter index: " << param_index << " for wearable type: " << this->getName() << LL_ENDL; + LL_WARNS() << "LLWearable::getVisualParam passed invalid parameter index: " << param_index << " for wearable type: " << this->getName() << LL_ENDL; } return (F32)-1.0; } From 7aca014ebc8c51aa07109eaf7dc77cbfee81c742 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Wed, 18 Dec 2024 12:00:11 -0800 Subject: [PATCH 2/3] #3305 Don't crash on invalid texture index in getTEWearableType (#3306) --- indra/llappearance/llavatarappearancedefines.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/indra/llappearance/llavatarappearancedefines.cpp b/indra/llappearance/llavatarappearancedefines.cpp index 5f98f2c8c1..47798844bc 100644 --- a/indra/llappearance/llavatarappearancedefines.cpp +++ b/indra/llappearance/llavatarappearancedefines.cpp @@ -300,7 +300,8 @@ EBakedTextureIndex LLAvatarAppearanceDictionary::findBakedByImageName(std::strin LLWearableType::EType LLAvatarAppearanceDictionary::getTEWearableType(ETextureIndex index ) const { - return getTexture(index)->mWearableType; + auto* tex = getTexture(index); + return tex ? tex->mWearableType : LLWearableType::WT_INVALID; } // static From c88a7d1d274b090f5ca7484a8b1f3ccc36aa1980 Mon Sep 17 00:00:00 2001 From: Maxim Nikolenko Date: Thu, 19 Dec 2024 17:06:34 +0200 Subject: [PATCH 3/3] #3302 fix crash on changing filter string when content is loading or there is no object selected --- indra/llui/llfolderview.h | 1 + indra/newview/llpanelcontents.cpp | 55 ++++++++++++++++---------- indra/newview/llpanelcontents.h | 2 + indra/newview/llpanelobjectinventory.h | 2 + 4 files changed, 40 insertions(+), 20 deletions(-) diff --git a/indra/llui/llfolderview.h b/indra/llui/llfolderview.h index 62ef2a0626..82637e33ea 100644 --- a/indra/llui/llfolderview.h +++ b/indra/llui/llfolderview.h @@ -414,6 +414,7 @@ public: virtual void doItem(LLFolderViewItem* item) {} void setApply(bool apply); void clearOpenFolders() { mOpenFolders.clear(); } + bool hasOpenFolders() { return !mOpenFolders.empty(); } protected: std::set mOpenFolders; bool mApply; diff --git a/indra/newview/llpanelcontents.cpp b/indra/newview/llpanelcontents.cpp index dbf56c2b6d..2624ef1207 100644 --- a/indra/newview/llpanelcontents.cpp +++ b/indra/newview/llpanelcontents.cpp @@ -139,32 +139,47 @@ void LLPanelContents::getState(LLViewerObject *objectp ) void LLPanelContents::onFilterEdit() { const std::string& filter_substring = mFilterEditor->getText(); - if (filter_substring.empty()) + if (!mPanelInventoryObject->hasInventory()) { - if (mPanelInventoryObject->getFilter().getFilterSubString().empty()) - { - // The current filter and the new filter are empty, nothing to do - return; - } - - mSavedFolderState.setApply(true); - mPanelInventoryObject->getRootFolder()->applyFunctorRecursively(mSavedFolderState); - - // Add a folder with the current item to the list of previously opened folders - LLOpenFoldersWithSelection opener; - mPanelInventoryObject->getRootFolder()->applyFunctorRecursively(opener); - mPanelInventoryObject->getRootFolder()->scrollToShowSelection(); + mDirtyFilter = true; } - else if (mPanelInventoryObject->getFilter().getFilterSubString().empty()) + else { - // The first letter in search term, save existing folder open state - if (!mPanelInventoryObject->getFilter().isNotDefault()) + if (filter_substring.empty()) { - mSavedFolderState.setApply(false); - mPanelInventoryObject->getRootFolder()->applyFunctorRecursively(mSavedFolderState); + if (mPanelInventoryObject->getFilter().getFilterSubString().empty()) + { + // The current filter and the new filter are empty, nothing to do + return; + } + + if (mDirtyFilter && !mSavedFolderState.hasOpenFolders()) + { + mPanelInventoryObject->getRootFolder()->setOpenArrangeRecursively(true, LLFolderViewFolder::ERecurseType::RECURSE_DOWN); + } + else + { + mSavedFolderState.setApply(true); + mPanelInventoryObject->getRootFolder()->applyFunctorRecursively(mSavedFolderState); + } + mDirtyFilter = false; + + // Add a folder with the current item to the list of previously opened folders + LLOpenFoldersWithSelection opener; + mPanelInventoryObject->getRootFolder()->applyFunctorRecursively(opener); + mPanelInventoryObject->getRootFolder()->scrollToShowSelection(); + } + else if (mPanelInventoryObject->getFilter().getFilterSubString().empty()) + { + // The first letter in search term, save existing folder open state + if (!mPanelInventoryObject->getFilter().isNotDefault()) + { + mSavedFolderState.setApply(false); + mPanelInventoryObject->getRootFolder()->applyFunctorRecursively(mSavedFolderState); + mDirtyFilter = false; + } } } - mPanelInventoryObject->getFilter().setFilterSubString(filter_substring); } diff --git a/indra/newview/llpanelcontents.h b/indra/newview/llpanelcontents.h index bb6308e8b8..6e02b17bab 100644 --- a/indra/newview/llpanelcontents.h +++ b/indra/newview/llpanelcontents.h @@ -70,6 +70,8 @@ protected: void getState(LLViewerObject *object); void onFilterEdit(); + bool mDirtyFilter { false }; + public: class LLFilterEditor* mFilterEditor; LLSaveFolderState mSavedFolderState; diff --git a/indra/newview/llpanelobjectinventory.h b/indra/newview/llpanelobjectinventory.h index abb48dbeed..154639e4bb 100644 --- a/indra/newview/llpanelobjectinventory.h +++ b/indra/newview/llpanelobjectinventory.h @@ -85,6 +85,8 @@ public: static void idle(void* user_data); + bool hasInventory(){ return mHaveInventory; }; + protected: void reset(); /*virtual*/ void inventoryChanged(LLViewerObject* object,