f
This commit is contained in:
parent
75f630f824
commit
b360b68fe8
1 changed files with 6 additions and 8 deletions
|
@ -842,14 +842,12 @@ proc checkRestart(state: var DecoderState) =
|
||||||
## Check if we might have run into a restart marker, then deal with it.
|
## Check if we might have run into a restart marker, then deal with it.
|
||||||
dec state.todoBeforeRestart
|
dec state.todoBeforeRestart
|
||||||
if state.todoBeforeRestart <= 0:
|
if state.todoBeforeRestart <= 0:
|
||||||
if state.bitsBuffered < 24:
|
if state.pos + 1 > state.len:
|
||||||
state.fillBitBuffer()
|
failInvalid()
|
||||||
|
if state.buffer[state.pos] != 0xFF or
|
||||||
if state.buffer[state.pos] == 0xFF:
|
state.buffer[state.pos + 1] notin {0xD0 .. 0xD7}:
|
||||||
if state.buffer[state.pos + 1] in {0xD0 .. 0xD7}:
|
|
||||||
state.pos += 2
|
|
||||||
else:
|
|
||||||
failInvalid("did not get expected restart marker")
|
failInvalid("did not get expected restart marker")
|
||||||
|
state.pos += 2
|
||||||
state.reset()
|
state.reset()
|
||||||
|
|
||||||
proc decodeBlocks(state: var DecoderState) =
|
proc decodeBlocks(state: var DecoderState) =
|
||||||
|
|
Loading…
Reference in a new issue