Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/pixie/fileformats/jpeg.nim
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,7 @@ proc decodeSOS(state: var DecoderState) =
if state.progressive:
if state.spectralStart > 63 or state.spectralEnd > 63:
failInvalid()
if state.spectralEnd > state.spectralEnd:
if state.spectralStart > state.spectralEnd:
failInvalid()
if state.successiveApproxHigh > 13 or state.successiveApproxLow > 13:
failInvalid()
Expand Down Expand Up @@ -715,7 +715,7 @@ proc decodeProgressiveContinuationBlock(

if state.eobRun != 0:
dec state.eobRun
for k in state.spectralStart ..< state.spectralEnd:
for k in state.spectralStart .. state.spectralEnd:
let zig = deZigZag[k]
if data[zig] != 0:
if state.readBit() != 0:
Expand Down
Binary file added tests/fileformats/jpeg/masters/chair_normal.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions tests/jpegsuite.nim
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ const jpegSuiteFiles* = [
"tests/fileformats/jpeg/masters/exif_overrun.jpg",
"tests/fileformats/jpeg/masters/grayscale_test.jpg",
"tests/fileformats/jpeg/masters/progressive.jpg",
"tests/fileformats/jpeg/masters/chair_normal.jpg",

"tests/fileformats/jpeg/masters/testimg.jpg",
"tests/fileformats/jpeg/masters/testimgp.jpg",
Expand Down
Loading