aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorMelanie Thielker2009-04-29 20:32:40 +0000
committerMelanie Thielker2009-04-29 20:32:40 +0000
commit98cdc1efddd5fb34537473cd2ae9beae020f585d (patch)
treeb16b10f13089f23d0dc211ea71854fa0519581c9 /OpenSim
parent* Correct log message format (diff)
downloadopensim-SC-98cdc1efddd5fb34537473cd2ae9beae020f585d.zip
opensim-SC-98cdc1efddd5fb34537473cd2ae9beae020f585d.tar.gz
opensim-SC-98cdc1efddd5fb34537473cd2ae9beae020f585d.tar.bz2
opensim-SC-98cdc1efddd5fb34537473cd2ae9beae020f585d.tar.xz
Fix a crash that will hit when an image asset is truncated in storage
Diffstat (limited to 'OpenSim')
-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)