Skip to content
This repository was archived by the owner on May 18, 2026. It is now read-only.

Commit 02bed33

Browse files
author
Software Antics
committed
Fixed security issues with image sharp.
1 parent 3cd5304 commit 02bed33

4 files changed

Lines changed: 26 additions & 23 deletions

File tree

‎FinalEngine.Examples.Sponza/Program.cs‎

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ private static void Main()
8181

8282
var watch = new Stopwatch();
8383
var watchInvoker = new StopwatchInvoker(watch);
84-
var gameTime = new GameTime(watchInvoker, 10000.0f);
84+
var gameTime = new GameTime(watchInvoker, 120.0f);
8585

8686
float fieldDepth = 10.0f;
8787
float fieldWidth = 10.0f;
@@ -189,7 +189,7 @@ private static void Main()
189189
back,
190190
front);
191191

192-
skyboxRenderer.SetSkybox(cubeTexture);
192+
//skyboxRenderer.SetSkybox(cubeTexture);
193193

194194
var controller = new ImGuiController(window.ClientSize.Width, window.ClientSize.Height);
195195

@@ -223,17 +223,17 @@ private static void Main()
223223

224224
geometryRenderer.Enqueue(model);
225225

226-
for (var i = 0; i < 5; i++)
227-
{
228-
for (var j = 0; j < 5; j++)
229-
{
230-
lightRenderer.Enqueue(new Light()
231-
{
232-
Type = LightType.Point,
233-
Position = new Vector3((i * 20) - 100, 4, (j * 20) - 50),
234-
});
235-
}
236-
}
226+
////for (var i = 0; i < 5; i++)
227+
////{
228+
//// for (var j = 0; j < 5; j++)
229+
//// {
230+
//// lightRenderer.Enqueue(new Light()
231+
//// {
232+
//// Type = LightType.Point,
233+
//// Position = new Vector3((i * 20) - 100, 4, (j * 20) - 50),
234+
//// });
235+
//// }
236+
////}
237237

238238
renderingEngine.Render(camera);
239239

‎FinalEngine.Rendering/FinalEngine.Rendering.csproj‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
<ItemGroup>
2323
<PackageReference Include="AssimpNet" Version="4.1.0" />
24-
<PackageReference Include="SixLabors.ImageSharp" Version="1.0.4" />
24+
<PackageReference Include="SixLabors.ImageSharp" Version="3.1.4" />
2525
<PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="8.0.0">
2626
<PrivateAssets>all</PrivateAssets>
2727
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>

‎FinalEngine.Rendering/Loaders/Textures/Texture2DResourceLoader.cs‎

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -52,15 +52,18 @@ public override ITexture2D LoadResource(string filePath)
5252

5353
for (int y = 0; y < image.Height; y++)
5454
{
55-
var row = image.GetPixelRowSpan(y);
56-
57-
for (int x = 0; x < image.Width; x++)
55+
image.ProcessPixelRows(processor =>
5856
{
59-
pixels.Add(row[x].R);
60-
pixels.Add(row[x].G);
61-
pixels.Add(row[x].B);
62-
pixels.Add(row[x].A);
63-
}
57+
for (int x = 0; x < image.Width; x++)
58+
{
59+
var pixel = processor.GetRowSpan(y);
60+
61+
pixels.Add(pixel[x].R);
62+
pixels.Add(pixel[x].G);
63+
pixels.Add(pixel[x].B);
64+
pixels.Add(pixel[x].A);
65+
}
66+
});
6467
}
6568

6669
var rasterState = this.renderDevice.Rasterizer.GetRasterState();

‎FinalEngine.Tests/FinalEngine.Tests.csproj‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
3131
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.6.3" />
3232
<PackageReference Include="OpenTK.Core" Version="4.8.0" />
33-
<PackageReference Include="SixLabors.ImageSharp" Version="1.0.4" />
33+
<PackageReference Include="SixLabors.ImageSharp" Version="3.1.4" />
3434
<PackageReference Include="StyleCop.Analyzers" Version="1.1.118">
3535
<PrivateAssets>all</PrivateAssets>
3636
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>

0 commit comments

Comments
 (0)