aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/CoreModules/Agent/TextureSender/J2KDecoderModule.cs16
1 files changed, 14 insertions, 2 deletions
diff --git a/OpenSim/Region/CoreModules/Agent/TextureSender/J2KDecoderModule.cs b/OpenSim/Region/CoreModules/Agent/TextureSender/J2KDecoderModule.cs
index 3343204..cf9a240 100644
--- a/OpenSim/Region/CoreModules/Agent/TextureSender/J2KDecoderModule.cs
+++ b/OpenSim/Region/CoreModules/Agent/TextureSender/J2KDecoderModule.cs
@@ -223,11 +223,23 @@ namespace OpenSim.Region.CoreModules.Agent.TextureSender
223 // Try to do some heuristics error correction! Yeah. 223 // Try to do some heuristics error correction! Yeah.
224 bool sane2Heuristics = true; 224 bool sane2Heuristics = true;
225 225
226 if (texture.LayerInfo.Length == 0) 226
227 if (texture.Image == null)
228 sane2Heuristics = false;
229
230 if (texture.LayerInfo == null)
227 sane2Heuristics = false; 231 sane2Heuristics = false;
228 232
229 if (sane2Heuristics) 233 if (sane2Heuristics)
230 { 234 {
235
236
237 if (texture.LayerInfo.Length == 0)
238 sane2Heuristics = false;
239 }
240
241 if (sane2Heuristics)
242 {
231 // Last layer start is less then the end of the file and last layer start is greater then 0 243 // Last layer start is less then the end of the file and last layer start is greater then 0
232 if (texture.LayerInfo[texture.LayerInfo.Length - 1].Start < texture.AssetData.Length && texture.LayerInfo[texture.LayerInfo.Length - 1].Start > 0) 244 if (texture.LayerInfo[texture.LayerInfo.Length - 1].Start < texture.AssetData.Length && texture.LayerInfo[texture.LayerInfo.Length - 1].Start > 0)
233 { 245 {
@@ -292,7 +304,7 @@ namespace OpenSim.Region.CoreModules.Agent.TextureSender
292 } 304 }
293 else 305 else
294 { 306 {
295 m_log.WarnFormat("[J2KDecoderModule]: JPEG2000 texture decoding failed for {0}", AssetId); 307 m_log.WarnFormat("[J2KDecoderModule]: JPEG2000 texture decoding failed for {0}. Is this a texture? is it J2K?", AssetId);
296 } 308 }
297 } 309 }
298 texture = null; // dereference and dispose of ManagedImage 310 texture = null; // dereference and dispose of ManagedImage