| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Prior to this change, libtiff relied on global error handlers,
which is problematic when libtiff used by multiple independent
libraries from within the same process, as they may unwittingly
clobber the error handling, introduce race conditions when setting
handlers, or otherwise have unintended side effects.
This change adds error handlers to the TIFF struct, which are
used preferentially when available. The error handlers are invoked
when the re-entrant error functions are called:
void TIFFErrorExtR(TIFF*, const char* module, const char* fmt, ...)
void TIFFWarningExtR(TIFF*, const char* module, const char* fmt, ...)
The handlers have a similar signature to the existing extended
handlers, additionally returning an int:
int TIFFErrorHandlerExtR(thandle_t, const char*, const char*, va_list)
thandle_t is the userdata passed to TIFFOpen
When the handler returns 1, the global handlers are not called.
Custom error/warning handlers may be installed on a per-file
basis by calling the Set functions:
TIFF* tif = TIFFOpen(...);
TIFFSetErrorHandlerExtR(tif, MyErrorHandler);
TIFFSetWarningHandlerExtR(tif, MyWarningHandler);
Additionally, the callsites to TIFFErrorExt and TIFFWarningExt
have been updated to call the reentrant versions.
|
|
|
|
|
| |
Note: my analyis of the issue would be that the use of the scanline API
is currently propably broken with OJPEG.
|
| |
|
| |
|
| |
|
| |
|
|\
| |
| |
| |
| | |
ojpeg: s/Depreciated/Deprecated/
See merge request libtiff/libtiff!149
|
| | |
|
|/ |
|
|\
| |
| |
| |
| |
| |
| | |
Make pointers returned via TIFFGetField const
Closes #11
See merge request libtiff/libtiff!118
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
According to http://bugzilla.maptools.org/show_bug.cgi?id=2125#c6
callers are not allowed to modify pointer or array values returned from
TIFFGetField or the like. So, make this explicit in the documentation
by specifying these things as const. Note that this is not an ABI
change, since C does not encode const in libraries. Also, this is
not really an API change, since the varargs call strips away all
the types anyway. So it really is more of a documentation change.
fixes #11
|
|/
|
|
| |
images such as https://gitlab.com/libtiff/libtiff/-/issues/181#note_302535232. Fixes #181
|
|
|
|
| |
one-single-strip. Complementary fix to 0356ea76bac908c61160d735f078437ace953bd3
|
| |
|
| |
|
|
|
|
| |
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=16844
|
|
|
|
| |
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=16793
|
|
|
|
|
|
| |
Follow-up of cf3ce6fab894414a336546f62adc57f02590a22c
Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=16602
Credit to OSS Fuzz
|
|
|
|
| |
close to UINT32_MAX. Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=16683
|
|
|
|
| |
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=16635
|
|
|
|
| |
Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=16400. master only
|
|
|
|
| |
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=15824. Credit to OSS Fuzz
|
|
|
|
|
| |
Fixes https://bugs.chromium.org/p/chromium/issues/detail?id=925269
Patch from Lei Zhang with little adaptations.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
... and add per-strile offset/bytecount loading capabilities.
Part of this commit makes the behaviour that was previously met when
libtiff was compiled with -DDEFER_STRILE_LOAD available for default builds
when specifying the new 'D' (Deferred) TIFFOpen() flag. In that mode, the [Tile/Strip][ByteCounts/Offsets]
arrays are only loaded when first accessed. This can speed-up the opening
of files stored on the network when just metadata retrieval is needed.
This mode has been used for years by the GDAL library when compiled with
its embeded libtiff copy.
To avoid potential out-of-tree code (typically codecs) that would use
the td_stripbytecount and td_stripoffset array inconditionnaly assuming they
have been loaded, those have been suffixed with _p (for protected). The
use of the new functions mentionned below is then recommended.
Another addition of this commit is the capability of loading only the
values of the offset/bytecount of the strile of interest instead of the
whole array. This is enabled with the new 'O' (Ondemand) flag of TIFFOpen()
(which implies 'D'). That behaviour has also been used by GDAL, which hacked
into the td_stripoffset/td_stripbytecount arrays directly. The new code
added in the _TIFFFetchStrileValue() and _TIFFPartialReadStripArray() internal
functions is mostly a port of what was in GDAL GTiff driver previously.
Related to that, the public TIFFGetStrileOffset[WithErr]() and TIFFGetStrileByteCount[WithErr]()
functions have been added to API. They are of particular interest when
using sparse files (with offset == bytecount == 0) and you want to detect
if a strile is present or not without decompressing the data, or updating
an existing sparse file.
They will also be used to enable a future enhancement where client code can entirely
skip bytecount loading in some situtations
A new test/defer_strile_loading.c test has been added to test the above
capabilities.
|
| |
|
|
|
|
|
|
|
| |
OJPEGReadHeaderInfoSecTablesQTable, OJPEGReadHeaderInfoSecTablesDcTable
and OJPEGReadHeaderInfoSecTablesAcTable
Patch by Nicolás Peña.
Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2670
|
|
|
|
| |
OJPEGReadHeaderInfoSecTablesDcTable and OJPEGReadHeaderInfoSecTablesAcTable
|
|
|
|
|
|
| |
when read fails.
Patch by Nicolás Peña.
Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2659
|
|
|
|
|
|
| |
OJPEGPreDecode(). This will avoid a divide by zero, and potential other issues.
Reported by Agostino Sarubbo.
Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2611
|
| |
|
|
|
|
| |
coming from GDAL internal libtiff
|
| |
|
|
|
|
| |
assignment within conditional expression
|
| |
|
|
|
|
|
|
|
| |
"Resource leak".
* libtiff/tif_ojpeg.c (OJPEGReadHeaderInfoSecStreamDht): Fix
Coverity 601720 "Resource leak".
|
|
|
|
| |
"Missing break in switch".
|
|
|
|
| |
various typos found by Debian lintian tool (GDAL #5756)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
sp->dec_codetab in LZWPreDecode (bug #2459)
* libtiff/tif_read.c: in TIFFReadBufferSetup(), avoid passing -1 size
to TIFFmalloc() if passed user buffer size is 0 (bug #2459)
* libtiff/tif_ojpeg.c: make Coverity happier (not a bug, #2459)
* libtiff/tif_dir.c: in _TIFFVGetField() and _TIFFVSetField(), make
Coverity happier (not a bug, #2459)
* libtiff/tif_dirread.c: in TIFFFetchNormalTag(), make Coverity happier
(not a bug, #2459)
* tools/tiff2pdf.c: close PDF file (bug #2479)
* tools/fax2ps.c: check malloc()/realloc() result (bug #2470)
* tools/tiffdump.c: detect cycle in TIFF directory chaining (bug #2463)
and avoid passing a NULL pointer to read() if seek() failed before (bug #2459)
* tools/tiffcrop.c: fix segfault if bad value passed to -Z option
(bug #2459) and add missing va_end in dump_info (#2459)
* tools/gif2tif.c: apply patch for CVE-2013-4243 (#2451)
|
| |
|
|
|
|
| |
stripoffsets or where loading these fails.
|
| |
|
|
|
|
|
|
| |
* tools/fax2ps.c (main): Use tmpfile() rather than mkstemp() since
it is much more portable. Tmpfile is included in ISO/IEC
9899:1990 and the WIN32 CRT.
|
| |
|
|
|
|
|
| |
libtiff/tif_zip.c: fix build errors for VC6
http://bugzilla.maptools.org/show_bug.cgi?id=2105
|
|
|
|
| |
http://bugzilla.maptools.org/show_bug.cgi?id=1999
|
| |
|