Skip to content

Commit 558ff99

Browse files
committed
revert Frame Dispose
1 parent 99d1266 commit 558ff99

File tree

1 file changed

+14
-21
lines changed

1 file changed

+14
-21
lines changed

src/ImageSharp/Formats/Jpeg/JpegDecoderCore.cs

Lines changed: 14 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -187,27 +187,20 @@ public Image<TPixel> Decode<TPixel>(BufferedReadStream stream, CancellationToken
187187
where TPixel : unmanaged, IPixel<TPixel>
188188
{
189189
using var spectralConverter = new SpectralConverter<TPixel>(this.Configuration);
190-
try
191-
{
192-
var scanDecoder = new HuffmanScanDecoder(stream, spectralConverter, cancellationToken);
193-
194-
this.ParseStream(stream, scanDecoder, cancellationToken);
195-
this.InitExifProfile();
196-
this.InitIccProfile();
197-
this.InitIptcProfile();
198-
this.InitXmpProfile();
199-
this.InitDerivedMetadataProperties();
200-
201-
return new Image<TPixel>(
202-
this.Configuration,
203-
spectralConverter.GetPixelBuffer(cancellationToken),
204-
this.Metadata);
205-
}
206-
catch
207-
{
208-
this.Frame?.Dispose();
209-
throw;
210-
}
190+
191+
var scanDecoder = new HuffmanScanDecoder(stream, spectralConverter, cancellationToken);
192+
193+
this.ParseStream(stream, scanDecoder, cancellationToken);
194+
this.InitExifProfile();
195+
this.InitIccProfile();
196+
this.InitIptcProfile();
197+
this.InitXmpProfile();
198+
this.InitDerivedMetadataProperties();
199+
200+
return new Image<TPixel>(
201+
this.Configuration,
202+
spectralConverter.GetPixelBuffer(cancellationToken),
203+
this.Metadata);
211204
}
212205

213206
/// <inheritdoc/>

0 commit comments

Comments
 (0)