Stop parsing when input is GIF87a.

This commit is contained in:
Relintai 2022-12-10 16:43:43 +01:00
parent 876e5f9e2f
commit 38ac3c7b7d

View File

@ -17,6 +17,15 @@ func read(source_file):
file.close() file.close()
var pos = 0 var pos = 0
# Header 'GIF89a' # Header 'GIF89a'
var sttr : String = ""
for i in range(6):
sttr += char(data[i])
if (sttr != "GIF89a"):
print("Can only open GIF89a!")
return null
pos = pos + 6 pos = pos + 6
# Logical Screen Descriptor # Logical Screen Descriptor
var width = get_int(data, pos) var width = get_int(data, pos)