From bc27c83073865ebcb3ec883ac2eefab07775311d Mon Sep 17 00:00:00 2001 From: Anton Firszov Date: Thu, 31 Aug 2017 04:03:07 +0200 Subject: [PATCH] fixed #159 for the progressive case --- .../Jpeg/GolangPort/Components/Decoder/InputProcessor.cs | 2 ++ .../Jpeg/GolangPort/Components/Decoder/OrigJpegScanDecoder.cs | 2 +- tests/Images/External | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/ImageSharp/Formats/Jpeg/GolangPort/Components/Decoder/InputProcessor.cs b/src/ImageSharp/Formats/Jpeg/GolangPort/Components/Decoder/InputProcessor.cs index 668c36ad5..6ee1d9e46 100644 --- a/src/ImageSharp/Formats/Jpeg/GolangPort/Components/Decoder/InputProcessor.cs +++ b/src/ImageSharp/Formats/Jpeg/GolangPort/Components/Decoder/InputProcessor.cs @@ -52,6 +52,8 @@ namespace SixLabors.ImageSharp.Formats.Jpeg.GolangPort.Components.Decoder /// public bool ReachedEOF => this.LastErrorCode == OrigDecoderErrorCode.UnexpectedEndOfStream; + public bool HasError => this.LastErrorCode != OrigDecoderErrorCode.NoError; + public OrigDecoderErrorCode LastErrorCode { get; private set; } public void ResetErrorState() => this.LastErrorCode = OrigDecoderErrorCode.NoError; diff --git a/src/ImageSharp/Formats/Jpeg/GolangPort/Components/Decoder/OrigJpegScanDecoder.cs b/src/ImageSharp/Formats/Jpeg/GolangPort/Components/Decoder/OrigJpegScanDecoder.cs index 3b09b5c3f..c13d3cf74 100644 --- a/src/ImageSharp/Formats/Jpeg/GolangPort/Components/Decoder/OrigJpegScanDecoder.cs +++ b/src/ImageSharp/Formats/Jpeg/GolangPort/Components/Decoder/OrigJpegScanDecoder.cs @@ -650,7 +650,7 @@ namespace SixLabors.ImageSharp.Formats.Jpeg.GolangPort.Components.Decoder bool bit; bp.DecodeBitUnsafe(out bit); - if (!bp.CheckEOFEnsureNoError()) + if (bp.HasError) { return int.MinValue; } diff --git a/tests/Images/External b/tests/Images/External index 90cd8c2da..f99c2ea41 160000 --- a/tests/Images/External +++ b/tests/Images/External @@ -1 +1 @@ -Subproject commit 90cd8c2dae16b18bb99e8c2166da72b3159e58c4 +Subproject commit f99c2ea41419cb3b3e80e5beeab611682252df78