Browse Source

Review suggestion from gfoidl:

Change condition to (offset <= this.Data.Length - byteCount)
pull/1944/head
Brian Popow 4 years ago
parent
commit
6f495f1642
  1. 2
      src/ImageSharp/Metadata/Profiles/IPTC/IptcProfile.cs

2
src/ImageSharp/Metadata/Profiles/IPTC/IptcProfile.cs

@ -307,7 +307,7 @@ namespace SixLabors.ImageSharp.Metadata.Profiles.Iptc
break;
}
if (isValidEntry && byteCount > 0 && (offset + byteCount <= this.Data.Length))
if (isValidEntry && byteCount > 0 && (offset <= this.Data.Length - byteCount))
{
var iptcData = new byte[byteCount];
Buffer.BlockCopy(this.Data, offset, iptcData, 0, (int)byteCount);

Loading…
Cancel
Save