This commit is contained in:
Ryan Oldenburg 2022-12-17 21:02:58 -06:00
parent cc68309225
commit b7a27392df
2 changed files with 4 additions and 4 deletions

View file

@ -1,4 +1,4 @@
version = "5.0.3" version = "5.0.4"
author = "Andre von Houck and Ryan Oldenburg" author = "Andre von Houck and Ryan Oldenburg"
description = "Full-featured 2d graphics library for Nim." description = "Full-featured 2d graphics library for Nim."
license = "MIT" license = "MIT"

View file

@ -444,13 +444,13 @@ proc reset(state: var DecoderState) =
proc decodeSOS(state: var DecoderState) = proc decodeSOS(state: var DecoderState) =
## Decode Start of Scan - header before the block data. ## Decode Start of Scan - header before the block data.
var len = state.readUint16be() - 2 var len = state.readUint16be() - 2
let scanComponentsU8 = state.readUint8()
state.scanComponents = scanComponentsU8.int state.scanComponents = state.readUint8().int
if state.scanComponents > state.components.len: if state.scanComponents > state.components.len:
failInvalid("extra components") failInvalid("extra components")
if scanComponentsU8 notin {1'u8, 3}: if cast[uint8](state.scanComponents) notin {1'u8, 3}:
failInvalid("unsupported scan component count") failInvalid("unsupported scan component count")
state.componentOrder.setLen(0) state.componentOrder.setLen(0)