From 38ac3c7b7d430b43f35fc846aee1e3fef084091f Mon Sep 17 00:00:00 2001 From: Relintai Date: Sat, 10 Dec 2022 16:43:43 +0100 Subject: [PATCH] Stop parsing when input is GIF87a. --- game/addons/gif-importer/GIFReader.gd | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/game/addons/gif-importer/GIFReader.gd b/game/addons/gif-importer/GIFReader.gd index 813e847..ec59859 100644 --- a/game/addons/gif-importer/GIFReader.gd +++ b/game/addons/gif-importer/GIFReader.gd @@ -17,6 +17,15 @@ func read(source_file): file.close() var pos = 0 # 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 # Logical Screen Descriptor var width = get_int(data, pos)