From d1780825e3f91a8acac8843ae0b5a78ce52ddd11 Mon Sep 17 00:00:00 2001 From: treeform Date: Sat, 7 May 2022 11:20:05 -0700 Subject: [PATCH] Ignore int16 overflows. --- src/pixie/fileformats/jpeg.nim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pixie/fileformats/jpeg.nim b/src/pixie/fileformats/jpeg.nim index ef11be1..9651439 100644 --- a/src/pixie/fileformats/jpeg.nim +++ b/src/pixie/fileformats/jpeg.nim @@ -770,8 +770,6 @@ proc idctBlock(component: var Component, offset: int, data: array[64, int16]) = component.channel.data[outPos + 3] = clampByte((x3 + t0) shr 17) component.channel.data[outPos + 4] = clampByte((x3 - t0) shr 17) -{.pop.} - proc decodeBlock(state: var DecoderState, comp, row, column: int) = ## Decodes a block. var data = state.components[comp].blocks[row][column] @@ -908,6 +906,8 @@ proc magnifyYBy2(mask: Mask): Mask = result[x, y * 2 + 0] = mask[x, y] div 2 + mask[x, y-1] div 2 result[x, y * 2 + 1] = mask[x, y] div 2 + mask[x, y+1] div 2 +{.pop.} + proc buildImage(state: var DecoderState): Image = ## Takes a jpeg image object and builds a pixie Image from it.