pull/3490/head
Malcolm Tyrrell 2020-11-06 09:57:48 +00:00
parent 0af05e7a60
commit 34e3e6293a
1 changed files with 3 additions and 6 deletions

View File

@ -638,8 +638,7 @@ inline void Accessor::Read(Value &obj, Asset &r) {
const char *typestr; const char *typestr;
type = ReadMember(obj, "type", typestr) ? AttribType::FromString(typestr) : AttribType::SCALAR; type = ReadMember(obj, "type", typestr) ? AttribType::FromString(typestr) : AttribType::SCALAR;
if (bufferView) if (bufferView) {
{
// Check length // Check length
unsigned long long byteLength = (unsigned long long)GetBytesPerComponent() * (unsigned long long)count; unsigned long long byteLength = (unsigned long long)GetBytesPerComponent() * (unsigned long long)count;
if ((byteOffset + byteLength) > bufferView->byteLength || (bufferView->byteOffset + byteOffset + byteLength) > bufferView->buffer->byteLength) { if ((byteOffset + byteLength) > bufferView->byteLength || (bufferView->byteOffset + byteOffset + byteLength) > bufferView->buffer->byteLength) {
@ -742,11 +741,9 @@ inline void CopyData(size_t count,
} }
} }
inline std::string getContextForErrorMessages(const std::string& id, const std::string& name) inline std::string getContextForErrorMessages(const std::string& id, const std::string& name) {
{
std::string context = id; std::string context = id;
if (!name.empty()) if (!name.empty()) {
{
context += " (\"" + name + "\")"; context += " (\"" + name + "\")";
} }
return context; return context;