aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorOren Hurvitz2013-02-03 09:43:17 +0200
committerJustin Clark-Casey (justincc)2013-02-09 02:04:26 +0000
commit745ef4015369f61b5d4bfc97d08fe1b16b3bb7e6 (patch)
treef1e6a1341f57945adfcbed23b5c8d15aae8c1f45 /OpenSim
parentFixed check for 0 results in GetUserAccounts() (diff)
downloadopensim-SC-745ef4015369f61b5d4bfc97d08fe1b16b3bb7e6.zip
opensim-SC-745ef4015369f61b5d4bfc97d08fe1b16b3bb7e6.tar.gz
opensim-SC-745ef4015369f61b5d4bfc97d08fe1b16b3bb7e6.tar.bz2
opensim-SC-745ef4015369f61b5d4bfc97d08fe1b16b3bb7e6.tar.xz
Fixed ReadSculptData(): the check whether there are enough bytes to read was incorrect
Diffstat (limited to '')
-rw-r--r--OpenSim/Framework/PrimitiveBaseShape.cs11
1 files changed, 6 insertions, 5 deletions
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
622 } 622 }
623 } 623 }
624 624
625 // This is only used at runtime. For sculpties this holds the texture data, and for meshes
626 // the mesh data.
625 public byte[] SculptData 627 public byte[] SculptData
626 { 628 {
627 get 629 get
@@ -1147,14 +1149,13 @@ namespace OpenSim.Framework
1147 1149
1148 public void ReadSculptData(byte[] data, int pos) 1150 public void ReadSculptData(byte[] data, int pos)
1149 { 1151 {
1150 byte[] SculptTextureUUID = new byte[16]; 1152 UUID SculptUUID;
1151 UUID SculptUUID = UUID.Zero; 1153 byte SculptTypel;
1152 byte SculptTypel = data[16+pos];
1153 1154
1154 if (data.Length+pos >= 17) 1155 if (data.Length-pos >= 17)
1155 { 1156 {
1156 _sculptEntry = true; 1157 _sculptEntry = true;
1157 SculptTextureUUID = new byte[16]; 1158 byte[] SculptTextureUUID = new byte[16];
1158 SculptTypel = data[16 + pos]; 1159 SculptTypel = data[16 + pos];
1159 Array.Copy(data, pos, SculptTextureUUID,0, 16); 1160 Array.Copy(data, pos, SculptTextureUUID,0, 16);
1160 SculptUUID = new UUID(SculptTextureUUID, 0); 1161 SculptUUID = new UUID(SculptTextureUUID, 0);