From 02cc77360d0c7ad08e254f96c9204596358ebc6b Mon Sep 17 00:00:00 2001 From: Brian Popow <38701097+brianpopow@users.noreply.github.com> Date: Mon, 17 Jan 2022 20:37:13 +0100 Subject: [PATCH] Change while condition to: offset < this.Data.Length - 4 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Günther Foidl --- src/ImageSharp/Metadata/Profiles/IPTC/IptcProfile.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ImageSharp/Metadata/Profiles/IPTC/IptcProfile.cs b/src/ImageSharp/Metadata/Profiles/IPTC/IptcProfile.cs index b456c66bbc..4eb0409db2 100644 --- a/src/ImageSharp/Metadata/Profiles/IPTC/IptcProfile.cs +++ b/src/ImageSharp/Metadata/Profiles/IPTC/IptcProfile.cs @@ -291,7 +291,7 @@ namespace SixLabors.ImageSharp.Metadata.Profiles.Iptc } int offset = 0; - while (offset + 4 < this.Data.Length) + while (offset < this.Data.Length - 4) { bool isValidTagMarker = this.Data[offset++] == IptcTagMarkerByte; byte recordNumber = this.Data[offset++];