Browse Source

Update src/ImageSharp/Metadata/Profiles/Exif/ExifReader.cs

Co-authored-by: Günther Foidl <gue@korporal.at>
pull/1760/head
Ildar Khayrutdinov 4 years ago
committed by GitHub
parent
commit
f370df7141
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      src/ImageSharp/Metadata/Profiles/Exif/ExifReader.cs

2
src/ImageSharp/Metadata/Profiles/Exif/ExifReader.cs

@ -459,7 +459,7 @@ namespace SixLabors.ImageSharp.Metadata.Profiles.Exif
if (size > 8)
{
ulong newOffset = this.ConvertToUInt64(this.offsetBuffer8);
if (newOffset > ulong.MaxValue || (newOffset + size) > (ulong)this.data.Length)
if (newOffset > ulong.MaxValue || newOffset > (ulong)(this.data.Length - size))
{
this.AddInvalidTag(new UnkownExifTag(tag));
return;

Loading…
Cancel
Save