Commit Graph

34 Commits

Author SHA1 Message Date
Even Rouault
a0faaf8910 Fix build failure due to previous commit 2016-07-10 16:56:18 +00:00
Even Rouault
292c431e5d * tools/tiffdump.c: fix a few misaligned 64-bit reads warned
by -fsanitize
2016-07-10 15:34:06 +00:00
Bob Friesenhahn
8ba4a1c894 Support large files under Windows using tif_unix.c and libtiff tools. 2015-08-19 02:31:04 +00:00
Bob Friesenhahn
d21d2b3057 * libtiff/tif_config.vc.h: Make adjustments to match the new
definitions that configure produces, including for WIN64.  Still
needs to be tested.

'lld' is not assured by the run-time DLLs and so GCC warns.
Add TIFF_SIZE_T and TIFF_SIZE_FORMAT to provide a type definition
and printf format specifier to deal with printing values of
'size_t' type.  In particular, this was necessary for WIN64.
Added a configure test for if the system headers provide 'optarg'
(normal case) and block out the many explicit 'extern' statements
in the utilities.  This was found to be necessary under Windows
when getopt is in a DLL and the symbols are already imported with
dllimport via standard header files.
2015-06-21 01:09:09 +00:00
Bob Friesenhahn
53c7c58dd7 * tools/tiffdump.c: Guard against arithmetic overflow when
calculating allocation buffer sizes.
2014-12-22 02:52:38 +00:00
Even Rouault
89bef1935b Fix various crasher bugs on fuzzed images.
* libtiff/tif_dir.c: TIFFSetField(): refuse to set negative values for
TIFFTAG_XRESOLUTION and TIFFTAG_YRESOLUTION that cause asserts when writing
the directory
* libtiff/tif_dirread.c: TIFFReadDirectory(): refuse to read ColorMap or
TransferFunction if BitsPerSample has not yet been read, otherwise reading
it later will cause user code to crash if BitsPerSample > 1
* libtiff/tif_getimage.c: TIFFRGBAImageOK(): return FALSE if LOGLUV with
SamplesPerPixel != 3, or if CIELAB with SamplesPerPixel != 3 or BitsPerSample != 8
* libtiff/tif_next.c: in the "run mode", use tilewidth for tiled images
instead of imagewidth to avoid crash
* tools/bmp2tiff.c: fix crash due to int overflow related to input BMP dimensions
* tools/tiff2pdf.c: fix crash due to invalid tile count (should likely be checked by
libtiff too). Detect invalid settings of BitsPerSample/SamplesPerPixel for CIELAB / ITULAB
* tools/tiffcrop.c: fix crash due to invalid TileWidth/TileHeight
* tools/tiffdump.c: fix crash due to overflow of entry count.
2014-12-21 15:15:31 +00:00
Bob Friesenhahn
3c92b0efc1 * tools/tiffdump.c: Fix double-free bug. 2014-12-06 15:58:40 +00:00
Even Rouault
abea4b2b04 * libtiff/tif_lzw.c: prevent potential null dereference of
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)
2014-11-20 16:47:21 +00:00
Frank Warmerdam
0055471655 avoid some clang warnings 2012-06-15 21:51:54 +00:00
Bob Friesenhahn
519b727004 * configure.ac: Support configuring TIFF_INT64_FORMAT and
TIFF_UINT64_FORMAT appropriately for MinGW32.

* tools/tiffdump.c (ReadDirectory): MinGW32 needs to use WIN32
printf conventions for 64-bit types because it uses the WIN32 CRT.

* libtiff/{tif_dumpmode.c,tif_luv.c,tif_lzw.c,tif_print.c,
tif_read.c,tif_strip.c,tif_thunder.c}: MinGW32 needs to use WIN32
printf conventions for 64-bit types because it uses the WIN32 CRT.

* tools/tiff2pdf.c (t2p_write_pdf_string): Fix printf syntax not
understood by WIN32 CRT.
2011-04-02 20:54:08 +00:00
Andrey Kiselev
004e0bab6d Tiny formatting fixes to improve code navigation. 2010-07-02 11:06:29 +00:00
Bob Friesenhahn
e3538640b6 C files should not use C++ style comments. 2010-06-21 19:09:26 +00:00
Bob Friesenhahn
4e0d97f83c * libtiff/tif_aux.c (_TIFFCheckRealloc): Improve error message so
that it is clearly a memory allocation error message, and also
includes the size of the allocation request.
2010-03-10 18:56:48 +00:00
Frank Warmerdam
46bac877c5 avoid 32/64bit casting warnings 2009-01-22 21:12:45 +00:00
Frank Warmerdam
c4c1a95ce4 fix ordering to avoid getopt redeclaration 2009-01-22 20:59:33 +00:00
Frank Warmerdam
3db9feb595 introduce libport.h prototypes to reduce warnings 2009-01-22 20:53:07 +00:00
Bob Friesenhahn
8d2fe9f4e2 * tools/tiffdump.c: When compiling for Microsoft Windows, apply
consistent (__int64) casting when testing if _lseeki64 has
successfully seeked as requested.  This is necessary for large
file support to work since off_t is only 32-bit.
2008-08-12 21:52:03 +00:00
Andrey Kiselev
33dbe6c262 Added support for MSVS 6.0. 2008-04-09 09:33:30 +00:00
Frank Warmerdam
3e75fc789f Added ssize_t typedef on Windows since it doesn't exist. This makes
it compile again on Windows.
2008-01-01 15:45:14 +00:00
Andrey Kiselev
e16f59e6e2 Number of problems fixed; now this utility can be built with gcc. 2007-07-04 11:31:36 +00:00
Joris Van Damme
6b42b6bad5 BigTIFF upgrade: tiffdump.c, complete except for IO standard library functions 2007-06-13 13:01:43 +00:00
Frank Warmerdam
b86f199feb preliminary support for MS MDI format, bug 1002 2005-11-21 03:35:05 +00:00
Andrey Kiselev
8c703c1e6e Fixed typeshift and typemask arrays initialization problem as per bug
http://bugzilla.remotesensing.org/show_bug.cgi?id=946
2005-10-31 13:08:19 +00:00
Andrey Kiselev
ad6776b90d Fixed crash when reading malformed tags. 2005-09-28 12:10:22 +00:00
Andrey Kiselev
9ece518261 Avoid warnings. 2005-09-13 14:09:10 +00:00
Andrey Kiselev
7f535ed3f1 Added support for TIFF_IFD datatype. 2005-07-25 13:48:58 +00:00
Andrey Kiselev
2988cbc5cc Fixed problem when read broken TIFFs with the wrong tag counts (Dmitry V.
Levin, Martin Pitt).
2005-01-05 20:38:38 +00:00
Andrey Kiselev
e7976c2ad8 Avoid warnings. 2004-09-03 08:16:01 +00:00
Andrey Kiselev
532d2ad4a7 config.h.in and config.h.vc files renamed in the tif_config.h.in and
tif_config.h.vc.
2004-08-01 10:35:02 +00:00
Andrey Kiselev
37001a073e Avoid warnings. 2004-06-04 11:50:09 +00:00
Andrey Kiselev
1482f0bf43 MSVC updates. 2004-04-15 10:26:06 +00:00
Frank Warmerdam
e3ada41e8b Added -m (maxitems) flag to usage message. 2003-09-02 13:28:09 +00:00
Frank Warmerdam
b049944746 Added TIFFTAG_JPEGTABLES entry in tag table. 2002-01-16 18:04:57 +00:00
Mike Welles
0ef31e1f62 Initial revision 1999-07-27 21:50:26 +00:00