mirror of
https://github.com/crskycode/GARbro.git
synced 2026-07-08 01:30:18 +08:00
(ImageFormat.FindFormat): ignore streams less than 4 bytes length.
This commit is contained in:
@@ -152,6 +152,8 @@ namespace GameRes
|
|||||||
|
|
||||||
public static System.Tuple<ImageFormat, ImageMetaData> FindFormat (Stream file, string filename = null)
|
public static System.Tuple<ImageFormat, ImageMetaData> FindFormat (Stream file, string filename = null)
|
||||||
{
|
{
|
||||||
|
if (file.Length < 4)
|
||||||
|
return null;
|
||||||
uint signature = FormatCatalog.ReadSignature (file);
|
uint signature = FormatCatalog.ReadSignature (file);
|
||||||
Lazy<string> ext = null;
|
Lazy<string> ext = null;
|
||||||
if (!string.IsNullOrEmpty (filename))
|
if (!string.IsNullOrEmpty (filename))
|
||||||
|
|||||||
Reference in New Issue
Block a user