Fix GIF global color table flag check

Zero is a truthy value, which is a problem when checking flags.
This commit is contained in:
Bianca Nenciu 2021-01-21 17:20:08 +02:00
parent f1628c1539
commit c78578c097
No known key found for this signature in database
GPG Key ID: 07E83B117A6B844D

View File

@ -585,7 +585,7 @@ class FastImage
# fields (1) + bg color (1) + pixel ratio (1)
fields = @stream.read(3).unpack("CCC")[0]
if fields & 0x80 # Global Color Table
if fields & 0x80 != 0 # Global Color Table
# 2 * (depth + 1) colors, each occupying 3 bytes (RGB)
@stream.skip(3 * 2 ** ((fields & 0x7) + 1))
end