copy for newImage

This commit is contained in:
Ryan Oldenburg 2022-06-14 17:04:39 -05:00
parent 7c6528983c
commit abf67489f1

View file

@ -105,6 +105,9 @@ proc decodeGif*(data: string): Gif {.raises: [PixieError].} =
pos += 9 pos += 9
if pos + localColorTableSize * 3 > data.len:
failInvalid()
var localColorTable: seq[ColorRGBX] var localColorTable: seq[ColorRGBX]
if hasLocalColorTable: if hasLocalColorTable:
localColorTable.setLen(localColorTableSize) localColorTable.setLen(localColorTableSize)
@ -384,7 +387,7 @@ proc decodeGifDimensions*(
result.height = data.readInt16(8).int result.height = data.readInt16(8).int
proc newImage*(gif: Gif): Image {.raises: [].} = proc newImage*(gif: Gif): Image {.raises: [].} =
gif.frames[0] gif.frames[0].copy()
when defined(release): when defined(release):
{.pop.} {.pop.}