You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have verified that I am running the latest version of ImageSharp
I have verified if the problem exist in both DEBUG and RELEASE mode
I have searched open and closed issues to ensure it has not already been reported
Description
atSystem.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgumentargument)
at SixLabors.ImageSharp.Memory.Buffer2DRegion`1.Clear()
at SixLabors.ImageSharp.Formats.Gif.GifDecoderCore.RestoreToBackground[TPixel](ImageFrame`1frame)
at SixLabors.ImageSharp.Formats.Gif.GifDecoderCore.ReadFrameColors[TPixel](Image`1&image, ImageFrame`1&previousFrame, Buffer2D`1indices, ReadOnlySpan`1colorTable,GifImageDescriptor&descriptor)
at SixLabors.ImageSharp.Formats.Gif.GifDecoderCore.ReadFrame[TPixel](Image`1&image, ImageFrame`1&previousFrame)
at SixLabors.ImageSharp.Formats.Gif.GifDecoderCore.Decode[TPixel](BufferedReadStreamstream,CancellationTokencancellationToken)
at SixLabors.ImageSharp.Formats.ImageDecoderUtilities.Decode[TPixel](IImageDecoderInternalsdecoder,Configurationconfiguration,Streamstream, Func`3largeImageExceptionFactory)
at SixLabors.ImageSharp.Formats.Gif.GifDecoder.Decode(Configurationconfiguration,Streamstream)
at SixLabors.ImageSharp.Image.Decode(Streamstream,Configurationconfig)
at SixLabors.ImageSharp.Image.WithSeekableStream[T](Configurationconfiguration,Streamstream, Func`2action)
at SixLabors.ImageSharp.Image.Load(Configurationconfiguration,Streamstream,IImageFormat&format)
at SixLabors.ImageSharp.Image.Load(Configurationconfiguration,Stringpath,IImageFormat&format)
at SixLabors.ImageSharp.Image.Load(Stringpath)
at GifClient.ViewModels.CropViewModel.<>c__DisplayClass38_0.<SaveAsync>b__1()in E:\lq\GifAdvanced\src\BlueClient\ViewModels\CropViewModel.cs:line 177
Activity
JimBobSquarePants commentedon Feb 2, 2021
I'll take this. It's due to bad descriptor bounds in the image defining a rectangle outside of the frame bounds.
Fix is easy enough. Use
Rectangle.Intersectto sanitize the value before requesting a rectangle from the buffer.Santize descriptor bounds. Fixes #1530
Santize descriptor bounds. Fixes #1530