Fixed ReadSculptData(): the check whether there are enough bytes to read was incorrect

0.7.4-extended
Oren Hurvitz 2013-02-03 09:43:17 +02:00 committed by Justin Clark-Casey (justincc)
parent 72838a04d6
commit 7fc820b3fd
1 changed files with 6 additions and 5 deletions

View File

@ -622,6 +622,8 @@ namespace OpenSim.Framework
}
}
// This is only used at runtime. For sculpties this holds the texture data, and for meshes
// the mesh data.
public byte[] SculptData
{
get
@ -1147,14 +1149,13 @@ namespace OpenSim.Framework
public void ReadSculptData(byte[] data, int pos)
{
byte[] SculptTextureUUID = new byte[16];
UUID SculptUUID = UUID.Zero;
byte SculptTypel = data[16+pos];
UUID SculptUUID;
byte SculptTypel;
if (data.Length+pos >= 17)
if (data.Length-pos >= 17)
{
_sculptEntry = true;
SculptTextureUUID = new byte[16];
byte[] SculptTextureUUID = new byte[16];
SculptTypel = data[16 + pos];
Array.Copy(data, pos, SculptTextureUUID,0, 16);
SculptUUID = new UUID(SculptTextureUUID, 0);