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.
parent
ce94f990bb
commit
7faf286d00
|
@ -633,6 +633,15 @@ namespace OpenSim.Region.Physics.Meshing
|
|||
|
||||
OpenMetaverse.Imaging.OpenJPEG.DecodeToImage(primShape.SculptData, out managedImage);
|
||||
|
||||
if (managedImage == null)
|
||||
{
|
||||
// In some cases it seems that the decode can return a null bitmap without throwing
|
||||
// an exception
|
||||
m_log.WarnFormat("[PHYSICS]: OpenJPEG decoded sculpt data for {0} to a null bitmap. Ignoring.", primName);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if ((managedImage.Channels & OpenMetaverse.Imaging.ManagedImage.ImageChannels.Alpha) != 0)
|
||||
managedImage.ConvertChannels(managedImage.Channels & ~OpenMetaverse.Imaging.ManagedImage.ImageChannels.Alpha);
|
||||
|
||||
|
|
Loading…
Reference in New Issue