diff options
-rw-r--r-- | indra/newview/llgltfmateriallist.cpp | 9 | ||||
-rw-r--r-- | indra/newview/llmaterialeditor.cpp | 5 |
2 files changed, 8 insertions, 6 deletions
diff --git a/indra/newview/llgltfmateriallist.cpp b/indra/newview/llgltfmateriallist.cpp index 25438eae5e..5e5e6425b8 100644 --- a/indra/newview/llgltfmateriallist.cpp +++ b/indra/newview/llgltfmateriallist.cpp @@ -45,7 +45,9 @@ #include "llworld.h" #include "tinygltf/tiny_gltf.h" -#include <strstream> + +#include <boost/iostreams/device/array.hpp> +#include <boost/iostreams/stream.hpp> #include <unordered_set> @@ -168,7 +170,7 @@ namespace void LLGLTFMaterialList::applyOverrideMessage(LLMessageSystem* msg, const std::string& data_in) { - std::istringstream str(data_in); + boost::iostreams::stream<boost::iostreams::array_source> str(data_in.data(), data_in.size()); LLSD data; @@ -539,8 +541,7 @@ void LLGLTFMaterialList::onAssetLoadComplete(const LLUUID& id, LLAssetType::ETyp LLSD asset; // read file into buffer - std::istrstream str(&buffer[0], static_cast<S32>(buffer.size())); - + boost::iostreams::stream<boost::iostreams::array_source> str(buffer.data(), buffer.size()); if (LLSDSerialize::deserialize(asset, str, buffer.size())) { if (asset.has("version") && LLGLTFMaterial::isAcceptedVersion(asset["version"].asString())) diff --git a/indra/newview/llmaterialeditor.cpp b/indra/newview/llmaterialeditor.cpp index dde238eddb..b5e494379d 100644 --- a/indra/newview/llmaterialeditor.cpp +++ b/indra/newview/llmaterialeditor.cpp @@ -63,8 +63,9 @@ #include "tinygltf/tiny_gltf.h" #include "lltinygltfhelper.h" -#include <strstream> +#include <boost/iostreams/device/array.hpp> +#include <boost/iostreams/stream.hpp> const std::string MATERIAL_BASE_COLOR_DEFAULT_NAME = "Base Color"; const std::string MATERIAL_NORMAL_DEFAULT_NAME = "Normal"; @@ -1245,7 +1246,7 @@ bool LLMaterialEditor::decodeAsset(const std::vector<char>& buffer) { LLSD asset; - std::istrstream str(&buffer[0], buffer.size()); + boost::iostreams::stream<boost::iostreams::array_source> str(buffer.data(), buffer.size()); if (LLSDSerialize::deserialize(asset, str, buffer.size())) { if (asset.has("version") && LLGLTFMaterial::isAcceptedVersion(asset["version"].asString())) |