From 745ef4015369f61b5d4bfc97d08fe1b16b3bb7e6 Mon Sep 17 00:00:00 2001 From: Oren Hurvitz Date: Sun, 3 Feb 2013 09:43:17 +0200 Subject: Fixed ReadSculptData(): the check whether there are enough bytes to read was incorrect --- OpenSim/Framework/PrimitiveBaseShape.cs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'OpenSim/Framework/PrimitiveBaseShape.cs') diff --git a/OpenSim/Framework/PrimitiveBaseShape.cs b/OpenSim/Framework/PrimitiveBaseShape.cs index 4c36819..c1e1a4f 100644 --- a/OpenSim/Framework/PrimitiveBaseShape.cs +++ b/OpenSim/Framework/PrimitiveBaseShape.cs @@ -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); -- cgit v1.1