Skip to content

Commit

Permalink
Fix zero-length IPTC mishandling
Browse files Browse the repository at this point in the history
  • Loading branch information
drewnoakes committed Nov 24, 2017
1 parent 48b46b9 commit ce4479f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions MetadataExtractor/Formats/Iptc/IptcReader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,8 @@ public IptcDirectory Extract([NotNull] SequentialReader reader, long length)
break;
}

// we need at least five bytes left to read a tag
if (offset + 5 > length)
// we need at least four bytes left to read a tag
if (offset + 4 > length)
{
directory.AddError("Too few bytes remain for a valid IPTC tag");
break;
Expand Down

0 comments on commit ce4479f

Please sign in to comment.