Browse Source

Fix ImageMetaData test

af/merge-core
James Jackson-South 9 years ago
parent
commit
da6cd47eb5
  1. 9
      src/ImageSharp/MetaData/Profiles/Exif/ExifProfile.cs
  2. 7
      src/ImageSharp/MetaData/Profiles/ICC/IccProfile.cs

9
src/ImageSharp/MetaData/Profiles/Exif/ExifProfile.cs

@ -84,8 +84,11 @@ namespace ImageSharp
} }
} }
this.data = new byte[other.data.Length]; if (other.data != null)
Buffer.BlockCopy(other.data, 0, this.data, 0, other.data.Length); {
this.data = new byte[other.data.Length];
Buffer.BlockCopy(other.data, 0, this.data, 0, other.data.Length);
}
} }
/// <summary> /// <summary>
@ -131,7 +134,7 @@ namespace ImageSharp
return null; return null;
} }
if (this.data.Length < (this.thumbnailOffset + this.thumbnailLength)) if (this.data == null || this.data.Length < (this.thumbnailOffset + this.thumbnailLength))
{ {
return null; return null;
} }

7
src/ImageSharp/MetaData/Profiles/ICC/IccProfile.cs

@ -59,8 +59,11 @@ namespace ImageSharp
Guard.NotNull(other, nameof(other)); Guard.NotNull(other, nameof(other));
// TODO: Do we need to copy anything else? // TODO: Do we need to copy anything else?
this.data = new byte[other.data.Length]; if (other.data != null)
Buffer.BlockCopy(other.data, 0, this.data, 0, other.data.Length); {
this.data = new byte[other.data.Length];
Buffer.BlockCopy(other.data, 0, this.data, 0, other.data.Length);
}
} }
/// <summary> /// <summary>

Loading…
Cancel
Save