diff options
author | Melanie Thielker | 2009-04-29 20:32:40 +0000 |
---|---|---|
committer | Melanie Thielker | 2009-04-29 20:32:40 +0000 |
commit | 98cdc1efddd5fb34537473cd2ae9beae020f585d (patch) | |
tree | b16b10f13089f23d0dc211ea71854fa0519581c9 | |
parent | * Correct log message format (diff) | |
download | opensim-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
-rw-r--r-- | OpenSim/Region/ClientStack/LindenUDP/J2KImage.cs | 12 |
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) |