diff --git a/GameRes/Image.cs b/GameRes/Image.cs index 562bf367..8cbf35cb 100644 --- a/GameRes/Image.cs +++ b/GameRes/Image.cs @@ -152,6 +152,8 @@ namespace GameRes public static System.Tuple FindFormat (Stream file, string filename = null) { + if (file.Length < 4) + return null; uint signature = FormatCatalog.ReadSignature (file); Lazy ext = null; if (!string.IsNullOrEmpty (filename))