Skip to content
Merged

5.0.4 #518

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
2 changes: 1 addition & 1 deletion pixie.nimble
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version = "5.0.3"
version = "5.0.4"
author = "Andre von Houck and Ryan Oldenburg"
description = "Full-featured 2d graphics library for Nim."
license = "MIT"
Expand Down
6 changes: 3 additions & 3 deletions src/pixie/fileformats/jpeg.nim
Original file line number Diff line number Diff line change
Expand Up @@ -444,13 +444,13 @@ proc reset(state: var DecoderState) =
proc decodeSOS(state: var DecoderState) =
## Decode Start of Scan - header before the block data.
var len = state.readUint16be() - 2
let scanComponentsU8 = state.readUint8()
state.scanComponents = scanComponentsU8.int

state.scanComponents = state.readUint8().int

if state.scanComponents > state.components.len:
failInvalid("extra components")

if scanComponentsU8 notin {1'u8, 3}:
if cast[uint8](state.scanComponents) notin {1'u8, 3}:
failInvalid("unsupported scan component count")

state.componentOrder.setLen(0)
Expand Down