mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-04-29 16:25:42 +00:00
fix #365
This commit is contained in:
parent
a819181591
commit
fef05cf2ca
1 changed files with 5 additions and 3 deletions
|
|
@ -856,12 +856,12 @@ void TSShape::writeName(Stream * s, S32 nameIndex)
|
||||||
S32 TSShape::readName(Stream * s, bool addName)
|
S32 TSShape::readName(Stream * s, bool addName)
|
||||||
{
|
{
|
||||||
static char buffer[256];
|
static char buffer[256];
|
||||||
S32 sz;
|
U32 sz;
|
||||||
S32 nameIndex = -1;
|
S32 nameIndex = -1;
|
||||||
s->read(&sz);
|
s->read(&sz);
|
||||||
if (sz)
|
if (sz>0 && sz<255)
|
||||||
{
|
{
|
||||||
s->read(sz*sizeof(char),buffer);
|
s->read(sz,buffer);
|
||||||
buffer[sz] = '\0';
|
buffer[sz] = '\0';
|
||||||
nameIndex = findName(buffer);
|
nameIndex = findName(buffer);
|
||||||
|
|
||||||
|
|
@ -881,6 +881,8 @@ S32 TSShape::readName(Stream * s, bool addName)
|
||||||
names.last() = buffer;
|
names.last() = buffer;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
Con::errorf("invalid TSShape::readName length!");
|
||||||
|
|
||||||
return nameIndex;
|
return nameIndex;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue