Skip to content

Commit

Permalink
Merge pull request #4074 from melissalinkert/gh-4034
Browse files Browse the repository at this point in the history
Gel: check IFD count in isThisType
  • Loading branch information
dgault authored Sep 29, 2023
2 parents c61e4ab + daa7c9c commit 345a958
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion components/formats-gpl/src/loci/formats/in/GelReader.java
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,11 @@ public GelReader() {
public boolean isThisType(RandomAccessInputStream stream) throws IOException {
TiffParser parser = new TiffParser(stream);
parser.setDoCaching(false);
IFD ifd = parser.getFirstIFD();
long[] offsets = parser.getIFDOffsets();
if (offsets.length == 0 || offsets.length > 2) {
return false;
}
IFD ifd = parser.getIFD(offsets[0]);
if (ifd == null) return false;
return ifd.containsKey(MD_FILETAG);
}
Expand Down

0 comments on commit 345a958

Please sign in to comment.