aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/J2KImage.cs12
1 files changed, 11 insertions, 1 deletions
diff --git a/OpenSim/Region/ClientStack/LindenUDP/J2KImage.cs b/OpenSim/Region/ClientStack/LindenUDP/J2KImage.cs
index 0727da5..e72cdab 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/J2KImage.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/J2KImage.cs
@@ -103,7 +103,17 @@ namespace OpenSim.Region.ClientStack.LindenUDP
103 { 103 {
104 if (!m_decoded) 104 if (!m_decoded)
105 return 0; 105 return 0;
106 return (ushort)(((m_asset.Data.Length - cFirstPacketSize + cImagePacketSize - 1) / cImagePacketSize) + 1); 106 try
107 {
108 return (ushort)(((m_asset.Data.Length - cFirstPacketSize + cImagePacketSize - 1) / cImagePacketSize) + 1);
109 }
110 catch(Exception e)
111 {
112 // If the asset is missing/destroyed/truncated, we will land
113 // here
114 //
115 return 0;
116 }
107 } 117 }
108 118
109 public void J2KDecodedCallback(UUID AssetId, OpenJPEG.J2KLayerInfo[] layers) 119 public void J2KDecodedCallback(UUID AssetId, OpenJPEG.J2KLayerInfo[] layers)