Browse Source

revert Frame Dispose

pull/2082/head
Scott Williams 5 years ago
parent
commit
558ff99b08
  1. 9
      src/ImageSharp/Formats/Jpeg/JpegDecoderCore.cs

9
src/ImageSharp/Formats/Jpeg/JpegDecoderCore.cs

@ -187,8 +187,7 @@ namespace SixLabors.ImageSharp.Formats.Jpeg
where TPixel : unmanaged, IPixel<TPixel> where TPixel : unmanaged, IPixel<TPixel>
{ {
using var spectralConverter = new SpectralConverter<TPixel>(this.Configuration); using var spectralConverter = new SpectralConverter<TPixel>(this.Configuration);
try
{
var scanDecoder = new HuffmanScanDecoder(stream, spectralConverter, cancellationToken); var scanDecoder = new HuffmanScanDecoder(stream, spectralConverter, cancellationToken);
this.ParseStream(stream, scanDecoder, cancellationToken); this.ParseStream(stream, scanDecoder, cancellationToken);
@ -203,12 +202,6 @@ namespace SixLabors.ImageSharp.Formats.Jpeg
spectralConverter.GetPixelBuffer(cancellationToken), spectralConverter.GetPixelBuffer(cancellationToken),
this.Metadata); this.Metadata);
} }
catch
{
this.Frame?.Dispose();
throw;
}
}
/// <inheritdoc/> /// <inheritdoc/>
public IImageInfo Identify(BufferedReadStream stream, CancellationToken cancellationToken) public IImageInfo Identify(BufferedReadStream stream, CancellationToken cancellationToken)

Loading…
Cancel
Save