From 5c04aacbe2e46d082d14513cf1c7bf19f92c84b7 Mon Sep 17 00:00:00 2001 From: Ryan Oldenburg Date: Wed, 25 May 2022 18:57:33 -0500 Subject: [PATCH] better check --- src/pixie/fileformats/jpeg.nim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pixie/fileformats/jpeg.nim b/src/pixie/fileformats/jpeg.nim index 8d0695a..43a9146 100644 --- a/src/pixie/fileformats/jpeg.nim +++ b/src/pixie/fileformats/jpeg.nim @@ -276,7 +276,7 @@ proc decodeSOF0(state: var DecoderState) = if quantizationTableId > 3: failInvalid("invalid quantization table id") - if vertical == 0 or vertical > 4 or horizontal == 0 or horizontal > 4: + if vertical notin {0, 1, 2, 4} or horizontal notin {0, 1, 2, 4}: failInvalid("invalid component scaling factor") component.xScale = vertical.int