mirror of
https://github.com/claunia/Claunia.RsrcFork.git
synced 2025-12-16 19:24:46 +00:00
* Claunia.RsrcFork/Resource.cs:
Added method to check if an ID exists. * Claunia.RsrcFork/ResourceFork.cs: Corrected check of offsets.
This commit is contained in:
@@ -1,3 +1,9 @@
|
||||
2016-09-06 Natalia Portillo <claunia@claunia.com>
|
||||
|
||||
* Resource.cs: Added method to check if an ID exists.
|
||||
|
||||
* ResourceFork.cs: Corrected check of offsets.
|
||||
|
||||
2016-09-02 Natalia Portillo <claunia@claunia.com>
|
||||
|
||||
* Claunia.RsrcFork.csproj: Downgrade framework requisites to
|
||||
|
||||
@@ -162,6 +162,11 @@ namespace Claunia.RsrcFork
|
||||
{
|
||||
return ids.ToArray();
|
||||
}
|
||||
|
||||
public bool ContainsId(short id)
|
||||
{
|
||||
return ids.Contains(id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -79,7 +79,7 @@ namespace Claunia.RsrcFork
|
||||
rsrcStream.Read(tmp, 0, 4);
|
||||
header.resourceMapLen = BitConverter.ToInt32(tmp.Reverse().ToArray(), 0);
|
||||
|
||||
if(header.resourceDataOff <= 0 || header.resourceDataOff <= 0 || header.resourceDataLen <= 0 || header.resourceMapLen <= 0)
|
||||
if(header.resourceDataOff <= 0 || header.resourceMapOff <= 0 || header.resourceDataLen <= 0 || header.resourceMapLen <= 0)
|
||||
throw new InvalidCastException("Not a resource fork");
|
||||
|
||||
if(header.resourceDataOff + header.resourceDataLen > rsrcStream.Length ||
|
||||
|
||||
Reference in New Issue
Block a user