From b7a27392df82fa6dc785e328ddb8db2f3e753c02 Mon Sep 17 00:00:00 2001 From: Ryan Oldenburg Date: Sat, 17 Dec 2022 21:02:58 -0600 Subject: [PATCH] 5.0.4 --- pixie.nimble | 2 +- src/pixie/fileformats/jpeg.nim | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pixie.nimble b/pixie.nimble index 1fdac48..eb9b4b4 100644 --- a/pixie.nimble +++ b/pixie.nimble @@ -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" diff --git a/src/pixie/fileformats/jpeg.nim b/src/pixie/fileformats/jpeg.nim index 77e17b2..e608355 100644 --- a/src/pixie/fileformats/jpeg.nim +++ b/src/pixie/fileformats/jpeg.nim @@ -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)