From 5a8474634ce2d75d4f835e62eecf5efcd85bb376 Mon Sep 17 00:00:00 2001 From: James Jackson-South Date: Mon, 10 Jul 2017 22:53:07 +1000 Subject: [PATCH] Fix broken EXIF test --- src/ImageSharp/MetaData/Profiles/Exif/ExifProfile.cs | 8 ++++---- src/ImageSharp/MetaData/Profiles/ICC/IccProfile.cs | 3 ++- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/ImageSharp/MetaData/Profiles/Exif/ExifProfile.cs b/src/ImageSharp/MetaData/Profiles/Exif/ExifProfile.cs index a7fd8fd6a8..fc77765b12 100644 --- a/src/ImageSharp/MetaData/Profiles/Exif/ExifProfile.cs +++ b/src/ImageSharp/MetaData/Profiles/Exif/ExifProfile.cs @@ -5,6 +5,7 @@ namespace ImageSharp { + using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.IO; @@ -82,10 +83,9 @@ namespace ImageSharp this.values.Add(new ExifValue(value)); } } - else - { - this.data = other.data; - } + + this.data = new byte[other.data.Length]; + Buffer.BlockCopy(other.data, 0, this.data, 0, other.data.Length); } /// diff --git a/src/ImageSharp/MetaData/Profiles/ICC/IccProfile.cs b/src/ImageSharp/MetaData/Profiles/ICC/IccProfile.cs index 978d5bc24f..d96bcb589a 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/IccProfile.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/IccProfile.cs @@ -59,7 +59,8 @@ namespace ImageSharp Guard.NotNull(other, nameof(other)); // TODO: Do we need to copy anything else? - this.data = other.data; + this.data = new byte[other.data.Length]; + Buffer.BlockCopy(other.data, 0, this.data, 0, other.data.Length); } ///