From f440e0f2fb6449dbc901ba180ce801c77673cd29 Mon Sep 17 00:00:00 2001 From: Jason Nelson Date: Thu, 19 Apr 2018 10:01:28 -0700 Subject: [PATCH] Reference IccColorantTableEntry directly --- .../Profiles/ICC/DataWriter/IccDataWriter.TagDataEntry.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/ImageSharp/MetaData/Profiles/ICC/DataWriter/IccDataWriter.TagDataEntry.cs b/src/ImageSharp/MetaData/Profiles/ICC/DataWriter/IccDataWriter.TagDataEntry.cs index 9ee4f0004..3f603fddf 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/DataWriter/IccDataWriter.TagDataEntry.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/DataWriter/IccDataWriter.TagDataEntry.cs @@ -206,8 +206,11 @@ namespace SixLabors.ImageSharp.MetaData.Profiles.Icc public int WriteColorantTableTagDataEntry(IccColorantTableTagDataEntry value) { int count = this.WriteUInt32((uint)value.ColorantData.Length); - foreach (IccColorantTableEntry colorant in value.ColorantData) + + for (int i = 0; i < value.ColorantData.Length; i++) { + ref IccColorantTableEntry colorant = ref value.ColorantData[i]; + count += this.WriteAsciiString(colorant.Name, 32, true); count += this.WriteUInt16(colorant.Pcs1); count += this.WriteUInt16(colorant.Pcs2);