Replies: 1 comment
-
Hi @lovell, thanks for letting us know about this. I suppose We should support |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
The example TIFF image found via fuzz testing at https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=65137 contains thousands of invalid tags, which libtiff quite happily attempts to allocate memory for. In this example a <1MB file consumes >3GB of RAM before failing.
Luckily recent versions of libtiff provide an extended
TIFFClientOpenExt
API (to eventually replaceTIFFClientOpen
) that allows us to pass in newTIFFOpenOptions
.Arguably the most useful of these is the does-what-it-says-on-the-tin
TIFFOpenOptionsSetMaxCumulatedMemAlloc
, which is about to be made available from libtiff v4.6.1 onwards.We should probably take advantage of this feature when available. This discussion is to determine the best way to expose this to libvips' users.
Possible options (there will be others):
unlimited
flag totiffload
that when set tofalse
(the default), uses this new API to set an arbitrary (libvips set and owned) RAM limit.max_cumulated_mem
(or similar) flag totiffload
that exposes the integral value to pass to this new API.I'm happy to work on this, but not quite sure of the best approach.
Beta Was this translation helpful? Give feedback.
All reactions