diff options
author | dahlia | 2013-11-01 13:45:09 -0700 |
---|---|---|
committer | dahlia | 2013-11-01 13:45:09 -0700 |
commit | 7faf286d0025da04497e2b593f629c6582607c78 (patch) | |
tree | 4ad37399f34774b548eb1d4bae1cdabd659a9d53 /OpenSim | |
parent | Merge branch 'master' of ssh://opensimulator.org/var/git/opensim (diff) | |
download | opensim-SC_OLD-7faf286d0025da04497e2b593f629c6582607c78.zip opensim-SC_OLD-7faf286d0025da04497e2b593f629c6582607c78.tar.gz opensim-SC_OLD-7faf286d0025da04497e2b593f629c6582607c78.tar.bz2 opensim-SC_OLD-7faf286d0025da04497e2b593f629c6582607c78.tar.xz |
add null check for jpeg2000 sculpt image decode failure. Note: the j2kDecodeCache folder should be cleared after updating to this revision so that sculpts containing alpha can be re-decoded and successfully meshed.
Diffstat (limited to 'OpenSim')
-rw-r--r-- | OpenSim/Region/Physics/Meshing/Meshmerizer.cs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/OpenSim/Region/Physics/Meshing/Meshmerizer.cs b/OpenSim/Region/Physics/Meshing/Meshmerizer.cs index 4ad0cb1..1f08b03 100644 --- a/OpenSim/Region/Physics/Meshing/Meshmerizer.cs +++ b/OpenSim/Region/Physics/Meshing/Meshmerizer.cs | |||
@@ -633,6 +633,15 @@ namespace OpenSim.Region.Physics.Meshing | |||
633 | 633 | ||
634 | OpenMetaverse.Imaging.OpenJPEG.DecodeToImage(primShape.SculptData, out managedImage); | 634 | OpenMetaverse.Imaging.OpenJPEG.DecodeToImage(primShape.SculptData, out managedImage); |
635 | 635 | ||
636 | if (managedImage == null) | ||
637 | { | ||
638 | // In some cases it seems that the decode can return a null bitmap without throwing | ||
639 | // an exception | ||
640 | m_log.WarnFormat("[PHYSICS]: OpenJPEG decoded sculpt data for {0} to a null bitmap. Ignoring.", primName); | ||
641 | |||
642 | return false; | ||
643 | } | ||
644 | |||
636 | if ((managedImage.Channels & OpenMetaverse.Imaging.ManagedImage.ImageChannels.Alpha) != 0) | 645 | if ((managedImage.Channels & OpenMetaverse.Imaging.ManagedImage.ImageChannels.Alpha) != 0) |
637 | managedImage.ConvertChannels(managedImage.Channels & ~OpenMetaverse.Imaging.ManagedImage.ImageChannels.Alpha); | 646 | managedImage.ConvertChannels(managedImage.Channels & ~OpenMetaverse.Imaging.ManagedImage.ImageChannels.Alpha); |
638 | 647 | ||