Browse Source

Fix ImageMetaData test

pull/298/head
James Jackson-South 9 years ago
parent
commit
ae6d91a556
  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];
Buffer.BlockCopy(other.data, 0, this.data, 0, other.data.Length);
if (other.data != null)
{
this.data = new byte[other.data.Length];
Buffer.BlockCopy(other.data, 0, this.data, 0, other.data.Length);
}
}
/// <summary>
@ -131,7 +134,7 @@ namespace ImageSharp
return null;
}
if (this.data.Length < (this.thumbnailOffset + this.thumbnailLength))
if (this.data == null || this.data.Length < (this.thumbnailOffset + this.thumbnailLength))
{
return null;
}

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

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

Loading…
Cancel
Save