dimension check

This commit is contained in:
Ryan Oldenburg 2022-08-06 20:49:55 -05:00
parent 188f6e931e
commit 02b0a91ea1

View file

@ -105,6 +105,9 @@ proc decodeGif*(data: string): Gif {.raises: [PixieError].} =
pos += 9
if imageWidth > screenWidth or imageHeight > screenHeight:
raise newException(PixieError, "Invalid GIF frame dimensions")
if pos + localColorTableSize * 3 > data.len:
failInvalid()