Merge pull request #104 from nooperation/fix_crashes_related_to_RAD-69

Fixs related to radegast issue #69 - 3D Scene viewer no longer works after updating to v2.45
This commit is contained in:
¡Cinder! ㊝
2025-03-12 23:46:06 -05:00
committed by GitHub
3 changed files with 13 additions and 3 deletions

View File

@@ -181,7 +181,7 @@ namespace OpenMetaverse
for (var j = i; j < data.Length; j++)
{
char spot = Convert.ToChar(data[j]);
if (spot == '\n')
if (spot == '\0')
{
endpos = j;
break;

View File

@@ -1058,7 +1058,9 @@ namespace LibreMetaverse.PrimMesher
if (needFaces)
copy.faces.AddRange(faces);
if (copy.calcVertexNormals == calcVertexNormals)
copy.calcVertexNormals = calcVertexNormals;
if (calcVertexNormals)
{
copy.vertexNormals.AddRange(vertexNormals);
copy.faceNormal = faceNormal;

View File

@@ -121,6 +121,10 @@ namespace LibreMetaverse.PrimMesher
}
catch (Exception e)
{
if (needsScaling)
{
bm.Dispose();
}
throw new Exception("Caught exception processing byte arrays in SculptMap(): e: " + e);
}
@@ -129,6 +133,11 @@ namespace LibreMetaverse.PrimMesher
width++;
height++;
}
if (needsScaling)
{
bm.Dispose();
}
}
public List<List<Coord>> ToRows(bool mirror)
@@ -167,7 +176,6 @@ namespace LibreMetaverse.PrimMesher
var info = new SKImageInfo(destWidth, destHeight);
var scaledImage = new SKBitmap(info);
srcImage.ScalePixels(scaledImage.PeekPixels(), new SKSamplingOptions(SKFilterMode.Linear));
srcImage.Dispose();
return scaledImage;
}
}