aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Physics/Meshing
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Physics/Meshing/Meshmerizer.cs12
1 files changed, 11 insertions, 1 deletions
diff --git a/OpenSim/Region/Physics/Meshing/Meshmerizer.cs b/OpenSim/Region/Physics/Meshing/Meshmerizer.cs
index 5413aa8..8a9260c 100644
--- a/OpenSim/Region/Physics/Meshing/Meshmerizer.cs
+++ b/OpenSim/Region/Physics/Meshing/Meshmerizer.cs
@@ -456,11 +456,21 @@ namespace OpenSim.Region.Physics.Meshing
456 { 456 {
457 OpenMetaverse.Imaging.ManagedImage unusedData; 457 OpenMetaverse.Imaging.ManagedImage unusedData;
458 OpenMetaverse.Imaging.OpenJPEG.DecodeToImage(primShape.SculptData, out unusedData, out idata); 458 OpenMetaverse.Imaging.OpenJPEG.DecodeToImage(primShape.SculptData, out unusedData, out idata);
459
460 if (idata == null)
461 {
462 // In some cases it seems that the decode can return a null bitmap without throwing
463 // an exception
464 m_log.WarnFormat("[PHYSICS]: OpenJPEG decoded sculpt data for {0} to a null bitmap. Ignoring.", primName);
465
466 return null;
467 }
468
459 unusedData = null; 469 unusedData = null;
460 470
461 //idata = CSJ2K.J2kImage.FromBytes(primShape.SculptData); 471 //idata = CSJ2K.J2kImage.FromBytes(primShape.SculptData);
462 472
463 if (cacheSculptMaps && idata != null) 473 if (cacheSculptMaps)
464 { 474 {
465 try { idata.Save(decodedSculptFileName, ImageFormat.MemoryBmp); } 475 try { idata.Save(decodedSculptFileName, ImageFormat.MemoryBmp); }
466 catch (Exception e) { m_log.Error("[SCULPT]: unable to cache sculpt map " + decodedSculptFileName + " " + e.Message); } 476 catch (Exception e) { m_log.Error("[SCULPT]: unable to cache sculpt map " + decodedSculptFileName + " " + e.Message); }