mirror of
https://github.com/opensim/opensim.git
synced 2026-08-13 05:05:43 +08:00
Fix a crash that will hit when an image asset is truncated in storage
This commit is contained in:
@@ -103,7 +103,17 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
|||||||
{
|
{
|
||||||
if (!m_decoded)
|
if (!m_decoded)
|
||||||
return 0;
|
return 0;
|
||||||
return (ushort)(((m_asset.Data.Length - cFirstPacketSize + cImagePacketSize - 1) / cImagePacketSize) + 1);
|
try
|
||||||
|
{
|
||||||
|
return (ushort)(((m_asset.Data.Length - cFirstPacketSize + cImagePacketSize - 1) / cImagePacketSize) + 1);
|
||||||
|
}
|
||||||
|
catch(Exception e)
|
||||||
|
{
|
||||||
|
// If the asset is missing/destroyed/truncated, we will land
|
||||||
|
// here
|
||||||
|
//
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void J2KDecodedCallback(UUID AssetId, OpenJPEG.J2KLayerInfo[] layers)
|
public void J2KDecodedCallback(UUID AssetId, OpenJPEG.J2KLayerInfo[] layers)
|
||||||
|
|||||||
Reference in New Issue
Block a user