Skip to content

Commit

Permalink
fixed #159 for the progressive case
Browse files Browse the repository at this point in the history
  • Loading branch information
antonfirsov committed Aug 31, 2017
1 parent b75481b commit bc27c83
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ public InputProcessor(Stream inputStream, byte[] temp)
/// </summary>
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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -650,7 +650,7 @@ private int RefineNonZeroes(ref InputProcessor bp, int zig, int nz, int delta)

bool bit;
bp.DecodeBitUnsafe(out bit);
if (!bp.CheckEOFEnsureNoError())
if (bp.HasError)
{
return int.MinValue;
}
Expand Down

0 comments on commit bc27c83

Please sign in to comment.