diff options
author | Justin Clark-Casey (justincc) | 2011-07-29 21:49:23 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2011-07-29 21:49:23 +0100 |
commit | 5043be13fb07a8e0a37c1f496e9bb6127b163dfd (patch) | |
tree | 557e65c7a2902974006bbf575a96c1f0db630183 | |
parent | fix extremely minor Ode bug where the _taintedPrimL list would always be clea... (diff) | |
download | opensim-SC-5043be13fb07a8e0a37c1f496e9bb6127b163dfd.zip opensim-SC-5043be13fb07a8e0a37c1f496e9bb6127b163dfd.tar.gz opensim-SC-5043be13fb07a8e0a37c1f496e9bb6127b163dfd.tar.bz2 opensim-SC-5043be13fb07a8e0a37c1f496e9bb6127b163dfd.tar.xz |
Return null from CreateMeshFromPrimMesher if OpenJPEG decoding of the sculpt data fails.
This is to address http://opensimulator.org/mantis/view.php?id=5612
-rw-r--r-- | OpenSim/Region/Physics/Meshing/Meshmerizer.cs | 12 |
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); } |