diff options
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/gltf/buffer_util.h | 14 | ||||
-rw-r--r-- | indra/newview/llinventorypanel.cpp | 6 |
2 files changed, 17 insertions, 3 deletions
diff --git a/indra/newview/gltf/buffer_util.h b/indra/newview/gltf/buffer_util.h index be36c5e90b..c231443a9e 100644 --- a/indra/newview/gltf/buffer_util.h +++ b/indra/newview/gltf/buffer_util.h @@ -147,6 +147,12 @@ namespace LL } template<> + inline void copyVec3<F32, LLVector2>(F32* src, LLVector2& dst) + { + dst.set(src[0], src[1]); + } + + template<> inline void copyVec3<F32, vec3>(F32* src, vec3& dst) { dst = vec3(src[0], src[1], src[2]); @@ -375,12 +381,18 @@ namespace LL template<class T> inline void copy(Asset& asset, Accessor& accessor, LLStrider<T>& dst) { - if (accessor.mBufferView == INVALID_INDEX) + if (accessor.mBufferView == INVALID_INDEX + || accessor.mBufferView >= asset.mBufferViews.size()) { LL_WARNS("GLTF") << "Invalid buffer" << LL_ENDL; return; } const BufferView& bufferView = asset.mBufferViews[accessor.mBufferView]; + if (bufferView.mBuffer >= asset.mBuffers.size()) + { + LL_WARNS("GLTF") << "Invalid buffer view" << LL_ENDL; + return; + } const Buffer& buffer = asset.mBuffers[bufferView.mBuffer]; const U8* src = buffer.mData.data() + bufferView.mByteOffset + accessor.mByteOffset; diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index a06e64b1dc..0da7e35c38 100644 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -771,6 +771,7 @@ void LLInventoryPanel::itemChanged(const LLUUID& item_id, U32 mask, const LLInve // Remove the item's UI. LLFolderViewFolder* parent = view_item->getParentFolder(); removeItemID(viewmodel_item->getUUID()); + bool was_favorite = view_item->isFavorite(); view_item->destroyView(); if(parent) { @@ -784,7 +785,7 @@ void LLInventoryPanel::itemChanged(const LLUUID& item_id, U32 mask, const LLInve updateFolderLabel(viewmodel_folder->getUUID()); } } - if (view_item->isFavorite()) + if (was_favorite) { parent->updateHasFavorites(false); // favorite was removed } @@ -2458,6 +2459,7 @@ bool LLInventoryFavoritesItemsPanel::removeFavorite(const LLUUID& id, const LLIn { removeItemID(viewmodel_item->getUUID()); } + bool was_favorite = view_item->isFavorite(); view_item->destroyView(); if (parent) { @@ -2467,7 +2469,7 @@ bool LLInventoryFavoritesItemsPanel::removeFavorite(const LLUUID& id, const LLIn { updateFolderLabel(viewmodel_folder->getUUID()); } - if (view_item->isFavorite()) + if (was_favorite) { parent->updateHasFavorites(false); // favorite was removed } |