Browse Source
Merge pull request #2716 from SixLabors/js/clear-buffers
Clear Pixel Buffers on Decode.
pull/2754/head
v3.1.4
Anton Firszov
2 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with
3 additions and
2 deletions
-
src/ImageSharp/Formats/Jpeg/Components/Decoder/SpectralConverter{TPixel}.cs
-
src/ImageSharp/Formats/Tga/TgaDecoderCore.cs
|
|
|
@ -201,7 +201,8 @@ internal class SpectralConverter<TPixel> : SpectralConverter, IDisposable |
|
|
|
this.pixelBuffer = allocator.Allocate2D<TPixel>( |
|
|
|
pixelSize.Width, |
|
|
|
pixelSize.Height, |
|
|
|
this.Configuration.PreferContiguousImageBuffers); |
|
|
|
this.Configuration.PreferContiguousImageBuffers, |
|
|
|
AllocationOptions.Clean); |
|
|
|
this.paddedProxyPixelRow = allocator.Allocate<TPixel>(pixelSize.Width + 3); |
|
|
|
|
|
|
|
// Component processors from spectral to RGB
|
|
|
|
|
|
|
|
@ -84,7 +84,7 @@ internal sealed class TgaDecoderCore : IImageDecoderInternals |
|
|
|
throw new UnknownImageFormatException("Width or height cannot be 0"); |
|
|
|
} |
|
|
|
|
|
|
|
Image<TPixel> image = Image.CreateUninitialized<TPixel>(this.configuration, this.fileHeader.Width, this.fileHeader.Height, this.metadata); |
|
|
|
Image<TPixel> image = new(this.configuration, this.fileHeader.Width, this.fileHeader.Height, this.metadata); |
|
|
|
Buffer2D<TPixel> pixels = image.GetRootFramePixelBuffer(); |
|
|
|
|
|
|
|
if (this.fileHeader.ColorMapType == 1) |
|
|
|
|