Description
Prerequisites
- I have written a descriptive issue title
- I have verified that I am running the latest version of ImageSharp
- I have verified if the problem exist in both
DEBUG
andRELEASE
mode - I have searched open and closed issues to ensure it has not already been reported
ImageSharp version
3.1.4
Other ImageSharp packages and versions
Environment (Operating system, version and so on)
Windows 11
Alpine 3.19
.NET Framework version
.NET 8
Description
Hello,
GIF
When using a certain GIF we are seeing OOM's.
When debugging this locally I allocate +- 20Gb when handling that specific payload 5 times in parallel.
Payload: https://github.com/ErazerBrecht/ImageSharp.Payloads/blob/master/ImageSharp.Payloads.Gif/funnyanim.gif
Source code: https://github.com/ErazerBrecht/ImageSharp.Payloads/blob/master/ImageSharp.Payloads.Gif/Program.cs
When changing the source code to use the 'earth.gif' it works as intended and there is no spike in memory allocation.
JPEG
We have some payloads that cause resource amplification. There are very small <1460 bytes but when using Imagesharp they result into a very big result (biggest one goes to >40Mb). This only happens when specifying a quality level in the JPG encoder.
When not using one the payloads throw on a DividebyZeroException.
Payloads
https://github.com/ErazerBrecht/ImageSharp.Payloads/blob/master/ImageSharp.Payloads.Jpeg/83.jpg
https://github.com/ErazerBrecht/ImageSharp.Payloads/blob/master/ImageSharp.Payloads.Jpeg/92.jpg
https://github.com/ErazerBrecht/ImageSharp.Payloads/blob/master/ImageSharp.Payloads.Jpeg/93.jpg
Source code: https://github.com/ErazerBrecht/ImageSharp.Payloads/blob/master/ImageSharp.Payloads.Jpeg/Program.cs
Payloads were created by: https://app.intigriti.com/profile/whatevicanhaz
Sincerely,
Brecht
Steps to Reproduce
See:
https://github.com/ErazerBrecht/ImageSharp.Payloads
Images
No response