Skip to content

Commit 0a0a5fa

Browse files
committed
make it just a constant and comment.
1 parent 327765f commit 0a0a5fa

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/pixie/fileformats/jpeg.nim

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ const
3939
0.uint32, 1, 3, 7, 15, 31, 63, 127, 255, 511,
4040
1023, 2047, 4095, 8191, 16383, 32767, 65535
4141
]
42-
jpegEndOfImage = 0xD9
4342

4443
type
4544
Huffman = object
@@ -878,7 +877,8 @@ proc checkRestart(state: var DecoderState) =
878877
if state.todoBeforeRestart <= 0:
879878
if state.pos + 1 > state.len:
880879
failInvalid()
881-
if state.buffer[state.pos] == 0xFF and state.buffer[state.pos+1] == jpegEndOfImage:
880+
# Handle getting a restart marker right at the end.
881+
if state.buffer[state.pos] == 0xFF and state.buffer[state.pos+1] == 0xD9:
882882
return
883883
if state.buffer[state.pos] != 0xFF or
884884
state.buffer[state.pos + 1] notin {0xD0 .. 0xD7}:

0 commit comments

Comments
 (0)