mirror of
https://github.com/SabreTools/SabreTools.Serialization.git
synced 2026-09-24 15:55:05 +00:00
Only read resources that are valid
This commit is contained in:
@@ -1194,7 +1194,7 @@ namespace SabreTools.Serialization.Deserializers
|
||||
|
||||
// Read the data from the offset
|
||||
offset = resourceDataEntry.DataRVA.ConvertVirtualAddress(sections);
|
||||
if (offset > 0 && resourceDataEntry.Size > 0)
|
||||
if (offset > 0 && resourceDataEntry.Size > 0 && offset + (int)resourceDataEntry.Size < data.Length)
|
||||
{
|
||||
data.Seek(offset, SeekOrigin.Begin);
|
||||
resourceDataEntry.Data = data.ReadBytes((int)resourceDataEntry.Size);
|
||||
|
||||
Reference in New Issue
Block a user