From 2364411a837d0cab4b618ede43462efb6d5cf00f 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 9ee4f00046..3f603fddfe 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);