Comments (8)
Thanks. I’ll have a look asap.
from imagesharp.
The issue seems to be caused by frame 35, all previous frames can be decoded.
Here is the frame with the issue:
frame35.zip
webpinfo
does not report any issue with the image.
from imagesharp.
The issue seems to be in HorizontalUnfilter
method of the AlphaDecoder and there in the SSE2 part.
from imagesharp.
Fix was simple enough. An underflow caused by casting (uint)(width - 8)
when width < 8.
from imagesharp.
Great - thanks for your quick response on fixing this
from imagesharp.
I have also tried the latest preview from your feed 4.0.0-alpha.0.9
It still crashes but with slightly different behaviour, I get a stack overflow instead:
Stack overflow.
Repeat 2383 times:
--------------------------------
at System.SR.InternalGetResourceString(System.String)
at System.SR.GetResourceString(System.String)
at System.ThrowHelper.GetResourceString(System.ExceptionResource)
at System.ThrowHelper.GetArgumentOutOfRangeException(System.ExceptionArgument, System.ExceptionResource)
at System.ThrowHelper.ThrowStartIndexArgumentOutOfRange_ArgumentOutOfRange_IndexMustBeLess()
at System.Array.LastIndexOf[[System.__Canon, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]](System.__Canon[], System.__Canon, Int32, Int32)
at System.Collections.Generic.List`1[[System.__Canon, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].LastIndexOf(System.__Canon, Int32, Int32)
--------------------------------
at System.SR.InternalGetResourceString(System.String)
at System.SR.GetResourceString(System.String)
at System.Array.CopyImpl(System.Array, Int32, System.Array, Int32, Int32, Boolean)
at System.Array.Copy(System.Array, System.Array, Int32)
at System.Collections.Generic.List`1[[System.__Canon, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].set_Capacity(Int32)
at System.Collections.Generic.List`1[[System.__Canon, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].AddWithResize(System.__Canon)
at System.SR.InternalGetResourceString(System.String)
at System.SR.GetResourceString(System.String)
at System.AccessViolationException..ctor()
at SixLabors.ImageSharp.Formats.Webp.AlphaDecoder.HorizontalUnfilter(System.Span`1<Byte>, System.Span`1<Byte>, System.Span`1<Byte>, Int32)
at SixLabors.ImageSharp.Formats.Webp.AlphaDecoder.GradientUnfilter(System.Span`1<Byte>, System.Span`1<Byte>, System.Span`1<Byte>, Int32)
at SixLabors.ImageSharp.Formats.Webp.AlphaDecoder.AlphaApplyFilter(Int32, Int32, System.Span`1<Byte>, Int32)
at SixLabors.ImageSharp.Formats.Webp.AlphaDecoder.ExtractAlphaRows(SixLabors.ImageSharp.Formats.Webp.Lossless.Vp8LDecoder)
at SixLabors.ImageSharp.Formats.Webp.AlphaDecoder.Decode()
at SixLabors.ImageSharp.Formats.Webp.Lossy.WebpLossyDecoder.Decode[[SixLabors.ImageSharp.PixelFormats.Rgba32, SixLabors.ImageSharp, Version=4.0.0.0, Culture=neutral, PublicKeyToken=d998eea7b14cab13]](SixLabors.ImageSharp.Memory.Buffer2D`1<SixLabors.ImageSharp.PixelFormats.Rgba32>, Int32, Int32, SixLabors.ImageSharp.Formats.Webp.WebpImageInfo, System.Buffers.IMemoryOwner`1<Byte>)
at SixLabors.ImageSharp.Formats.Webp.WebpAnimationDecoder.DecodeImageFrameData[[SixLabors.ImageSharp.PixelFormats.Rgba32, SixLabors.ImageSharp, Version=4.0.0.0, Culture=neutral, PublicKeyToken=d998eea7b14cab13]](SixLabors.ImageSharp.Formats.Webp.Chunks.WebpFrameData, SixLabors.ImageSharp.Formats.Webp.WebpImageInfo)
at SixLabors.ImageSharp.Formats.Webp.WebpAnimationDecoder.ReadFrame[[SixLabors.ImageSharp.PixelFormats.Rgba32, SixLabors.ImageSharp, Version=4.0.0.0, Culture=neutral, PublicKeyToken=d998eea7b14cab13]](SixLabors.ImageSharp.IO.BufferedReadStream, SixLabors.ImageSharp.Image`1<SixLabors.ImageSharp.PixelFormats.Rgba32> ByRef, SixLabors.ImageSharp.ImageFrame`1<SixLabors.ImageSharp.PixelFormats.Rgba32> ByRef, UInt32, UInt32, SixLabors.ImageSharp.Color)
at SixLabors.ImageSharp.Formats.Webp.WebpAnimationDecoder.Decode[[SixLabors.ImageSharp.PixelFormats.Rgba32, SixLabors.ImageSharp, Version=4.0.0.0, Culture=neutral, PublicKeyToken=d998eea7b14cab13]](SixLabors.ImageSharp.IO.BufferedReadStream, SixLabors.ImageSharp.Formats.Webp.WebpFeatures, UInt32, UInt32, UInt32)
at SixLabors.ImageSharp.Formats.Webp.WebpDecoderCore.Decode[[SixLabors.ImageSharp.PixelFormats.Rgba32, SixLabors.ImageSharp, Version=4.0.0.0, Culture=neutral, PublicKeyToken=d998eea7b14cab13]](SixLabors.ImageSharp.IO.BufferedReadStream, System.Threading.CancellationToken)
at SixLabors.ImageSharp.Formats.ImageDecoderUtilities.Decode[[SixLabors.ImageSharp.PixelFormats.Rgba32, SixLabors.ImageSharp, Version=4.0.0.0, Culture=neutral, PublicKeyToken=d998eea7b14cab13]](SixLabors.ImageSharp.Formats.IImageDecoderInternals, SixLabors.ImageSharp.Configuration, System.IO.Stream, System.Func`3<SixLabors.ImageSharp.Memory.InvalidMemoryOperationException,SixLabors.ImageSharp.Size,SixLabors.ImageSharp.InvalidImageContentException>, System.Threading.CancellationToken)
at SixLabors.ImageSharp.Formats.ImageDecoderUtilities.Decode[[SixLabors.ImageSharp.PixelFormats.Rgba32, SixLabors.ImageSharp, Version=4.0.0.0, Culture=neutral, PublicKeyToken=d998eea7b14cab13]](SixLabors.ImageSharp.Formats.IImageDecoderInternals, SixLabors.ImageSharp.Configuration, System.IO.Stream, System.Threading.CancellationToken)
at SixLabors.ImageSharp.Formats.Webp.WebpDecoder.Decode[[SixLabors.ImageSharp.PixelFormats.Rgba32, SixLabors.ImageSharp, Version=4.0.0.0, Culture=neutral, PublicKeyToken=d998eea7b14cab13]](SixLabors.ImageSharp.Formats.Webp.WebpDecoderOptions, System.IO.Stream, System.Threading.CancellationToken)
at SixLabors.ImageSharp.Formats.SpecializedImageDecoder`1[[System.__Canon, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].Decode[[SixLabors.ImageSharp.PixelFormats.Rgba32, SixLabors.ImageSharp, Version=4.0.0.0, Culture=neutral, PublicKeyToken=d998eea7b14cab13]](SixLabors.ImageSharp.Formats.DecoderOptions, System.IO.Stream, System.Threading.CancellationToken)
at SixLabors.ImageSharp.Formats.Webp.WebpDecoder.Decode(SixLabors.ImageSharp.Formats.DecoderOptions, System.IO.Stream, System.Threading.CancellationToken)
at SixLabors.ImageSharp.Formats.ImageDecoder+<>c__DisplayClass1_0.<Decode>b__0(System.IO.Stream)
at SixLabors.ImageSharp.Formats.ImageDecoder.<WithSeekableStream>g__PeformActionAndResetPosition|11_0[[System.__Canon, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]](System.IO.Stream, Int64, <>c__DisplayClass11_0`1<System.__Canon> ByRef)
at SixLabors.ImageSharp.Formats.ImageDecoder.WithSeekableStream[[System.__Canon, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]](SixLabors.ImageSharp.Formats.DecoderOptions, System.IO.Stream, System.Func`2<System.IO.Stream,System.__Canon>)
at SixLabors.ImageSharp.Formats.ImageDecoder.Decode(SixLabors.ImageSharp.Formats.DecoderOptions, System.IO.Stream)
at SixLabors.ImageSharp.Image.Decode(SixLabors.ImageSharp.Formats.DecoderOptions, System.IO.Stream)
at SixLabors.ImageSharp.Image+<>c__DisplayClass80_0.<Load>b__0(System.IO.Stream)
at SixLabors.ImageSharp.Image.WithSeekableStream[[System.__Canon, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]](SixLabors.ImageSharp.Formats.DecoderOptions, System.IO.Stream, System.Func`2<System.IO.Stream,System.__Canon>)
at SixLabors.ImageSharp.Image.Load(SixLabors.ImageSharp.Formats.DecoderOptions, System.IO.Stream)
at SixLabors.ImageSharp.Image.Load(SixLabors.ImageSharp.Formats.DecoderOptions, System.String)
at SixLabors.ImageSharp.Image.Load(System.String)
at Program.<Main>$(System.String[])
from imagesharp.
Fantastic, thank you! Will you be able to break a release that contains this fix soon after it is merged?
from imagesharp.
Yeah. We've got one more issue I want to fix then I'll push a bugfix release.
from imagesharp.
Related Issues (20)
- CR2: System.NotSupportedException: Missing SOI marker offset for tiff with old jpeg compression HOT 2
- NullReferenceException when trying to load an animated PNG HOT 1
- Black Background after resizing in the latest version. HOT 4
- Simple conversion of Tiff file to PNG or JPG generates a strange result, even, at certain times, it is in 3D perspective HOT 6
- Please backport CVE-2024-27929 to 2.1.x HOT 20
- no vulnerability free version for netstandard or netframework 4.7 HOT 1
- Cannot update to v2.1.7 due to vulnerability tag HOT 4
- Exception SixLabors.ImageSharp.ImageFormatException: 'reserved bytes should be zero' when using Image.LoadAsync HOT 7
- Exif rotation and save HOT 4
- Error SixLabors.ImageSharp.ImageFormatException: 'Unexpected chunk followed VP8X header' HOT 3
- File (detected as bmp) fails to open, consumes a lot of memory HOT 4
- regression on latest.. 3 vs 2 with GIF HOT 6
- APNG Decoder incorrectly handles frame offsets and dispose previous with blend over HOT 3
- Hard crash (Internal CLR error) with corrupt PNG image HOT 3
- File conversion from jpg to webp changes colors of the image HOT 1
- Malicious hand-crafted PNG can be used to trigger DOS attack HOT 14
- I have encountered a bug with heigh and width of image HOT 4
- Missing Separable Blending Modes? HOT 2
- AccessViolationException when loading corrupt GIF
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from imagesharp.