Skip to content

Commit

Permalink
prevent OOM when cataloguing some RAW files
Browse files Browse the repository at this point in the history
  • Loading branch information
deckerst committed Aug 28, 2024
1 parent 0f9fc28 commit 98c39c2
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6808,6 +6808,11 @@ private void parseTiffHeaders(ByteOrderedDataInputStream dataInputStream) throws
}
firstIfdOffset -= 8;
if (firstIfdOffset > 0) {
// TLAD start
if (firstIfdOffset > ATTRIBUTE_SIZE_DANGER_THRESHOLD) {
throw new IOException("dangerous IFD offset=" + firstIfdOffset);
}
// TLAD end
dataInputStream.skipFully(firstIfdOffset);
}
}
Expand Down

0 comments on commit 98c39c2

Please sign in to comment.