Commit Graph

636 Commits

Author SHA1 Message Date
Bob Friesenhahn
1752529e75 * tools/tiffcrop.c (ROTATE_ANY): Fix Coverity 1294542 "Logical
vs. bitwise operator".
2015-05-28 01:50:20 +00:00
Even Rouault
7bed6738f2 * tools/tiffdither.c: check memory allocations to avoid writing to
NULL pointer. Also check multiplication overflow. Fixes #2501,
CVE-2014-8128. Derived from patch by Petr Gajdos.
2015-03-02 16:16:38 +00:00
Even Rouault
a17a6e5ecd * automake: updated to 1.15
* libtool: updated to 2.4.5
2015-01-26 10:29:40 +00:00
Even Rouault
45922132cf * tools/tiff2pdf.c: Fix two crashes (oCERT-2014-013) 2015-01-22 09:58:49 +00:00
Olivier Paquet
79676ae61c * tools/tiff2pdf.c: Fixed unsigned integer addition overflow detection. 2015-01-05 19:03:11 +00:00
Bob Friesenhahn
429b3fdc90 * Update bundled libtool to 2.4.4 release. 2014-12-29 15:34:22 +00:00
Bob Friesenhahn
fdfa1a026f * tools/tiffcrop.c: Fix warnings about variables set but not used. 2014-12-26 16:32:31 +00:00
Bob Friesenhahn
3b48ce4c7b * tools/tiffgt.c: Fix warnings about unused parameters. 2014-12-26 16:06:41 +00:00
Even Rouault
34d71374cc * tools/tiff2pdf.c: fix buffer overflow on some YCbCr JPEG compressed images.
http://bugzilla.maptools.org/show_bug.cgi?id=2445
2014-12-24 16:32:28 +00:00
Even Rouault
a42442d21f * tools/tiff2pdf.c: fix buffer overflow on YCbCr JPEG compressed image.
Derived from patch by Petr Gajdos,
http://bugzilla.maptools.org/show_bug.cgi?id=2443
2014-12-24 15:38:11 +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
5db18217c3 * tools/tiff2bw.c: when Photometric=RGB, the utility only works if
SamplesPerPixel = 3. Enforce that
http://bugzilla.maptools.org/show_bug.cgi?id=2485 (CVE-2014-8127)
2014-12-21 20:58:29 +00:00
Even Rouault
aaf52fa411 * tools/pal2rgb.c, tools/thumbnail.c: fix crash by disabling TIFFTAG_INKNAMES
copying. The right fix would be to properly copy it, but not worth the burden
for those esoteric utilities.
http://bugzilla.maptools.org/show_bug.cgi?id=2484 (CVE-2014-8127)
2014-12-21 20:04:31 +00:00
Even Rouault
47647443c1 * tools/thumbnail.c: fix out-of-buffer write
http://bugzilla.maptools.org/show_bug.cgi?id=2489 (CVE-2014-8128)
2014-12-21 19:53:59 +00:00
Even Rouault
1246f97138 * tools/thumbnail.c, tools/tiffcmp.c: only read/write TIFFTAG_GROUP3OPTIONS
or TIFFTAG_GROUP4OPTIONS if compression is COMPRESSION_CCITTFAX3 or
COMPRESSION_CCITTFAX4
http://bugzilla.maptools.org/show_bug.cgi?id=2493 (CVE-2014-8128)
2014-12-21 18:52:42 +00:00
Even Rouault
29f531aeec * tools/tiff2pdf.c: check return code of TIFFGetField() when reading
TIFFTAG_SAMPLESPERPIXEL
2014-12-21 17:36:36 +00:00
Even Rouault
2dae28a91b * tools/tiffcp.c: fix crash when converting YCbCr JPEG-compressed to none.
Based on patch by Tomasz Buchert (http://bugzilla.maptools.org/show_bug.cgi?id=2480)
Description: fix for Debian bug #741451
tiffcp crashes when converting JPEG-encoded TIFF to a different
encoding (like none or lzw). For example this will probably fail:
tiffcp -c none jpeg_encoded_file.tif output.tif
The reason is that when the input file contains JPEG data,
the tiffcp code forces conversion to RGB space. However,
the output normally inherits YCbCr subsampling parameters
from the input, which leads to a smaller working buffer
than necessary. The buffer is subsequently overrun inside
cpStripToTile() (called from writeBufferToContigTiles).
Note that the resulting TIFF file would be scrambled even
if tiffcp wouldn't crash, since the output file would contain
RGB data intepreted as subsampled YCbCr values.
This patch fixes the problem by forcing RGB space on the output
TIF if the input is JPEG-encoded and output is *not* JPEG-encoded.
Author: Tomasz Buchert <tomasz.buchert@inria.fr>
2014-12-21 16:28:37 +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
570fd679f6 * tools/tiff2pdf.c: Assure that memory size calculations for
_TIFFmalloc() do not overflow the range of tmsize_t.
2014-12-10 02:53:30 +00:00
Even Rouault
3f2b81f2c2 tools/thumbnail.c, tools/tiffcrop.c: fix heap read over-run found with Valgrind and Address Sanitizer on test suite 2014-12-07 22:33:06 +00:00
Bob Friesenhahn
02567e23b9 * tools/tiff2pdf.c (t2p_read_tiff_init): TIFFTAG_TRANSFERFUNCTION
tag can return one channel, with the other two channels set to
NULL.  The tiff2pdf code was expecting that other two channels
were duplicate pointers in the case where there is only one
channel.  Detect this condition in order to avoid a crash, and
presumably perform correctly with just one channel.
2014-12-07 19:32:25 +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
Even Rouault
d1be5cb7ad * automake: updated to 1.14.1
* libtool: updated to 2.4.3
* HOWTO-RELEASE: small update about autotools building order
2014-11-20 14:28:16 +00:00
Olivier Paquet
e4f269ed3f * tools/tiff2pdf.c: Preserve input file directory order when pages
are tagged with the same page number.
2014-10-20 17:52:05 +00:00
Bob Friesenhahn
f6fc518396 * tools/tiff2rgba.c (]): Fixed tiff2rgba usage message in that zip
was wrongly described.  Fix suggested by Miguel Medalha.
2014-06-08 03:37:01 +00:00
Lee Howard
e289d76bce Resolves a couple of buffer overflow issues pointed out by Pedro Ribeiro (pedrib@gmail.com). 2013-09-20 16:09:01 +00:00
Lee Howard
7b8ee1facf From: David Ryskalczyk <d235j.1@gmail.com>
Date: Thu, 18 Jul 2013 14:36:47 -0400

Here's a patch to correct an issue with creating G4-compressed PDFs.

The issue is caused by == being used to compare bitfields when only
one bit is intended to be compared. Some of the tiffs I have had both
T2P_CS_ICCBASED and T2P_CS_BILEVEL set; therefore, the current code
will fail, producing certain pages that are inverted.

The patch follows, and is also attached.

--David
2013-09-20 15:35:37 +00:00
Frank Warmerdam
163627448a fix possible OOB write in gif2tiff.c 2013-08-14 13:59:16 +00:00
Frank Warmerdam
44650c28f1 make more resistent to corrupt/hostile input files (#2450, CVE-2013-4231) 2013-08-14 05:18:53 +00:00
Frank Warmerdam
67d92d90f8 ensure return after memory allocation failure (#2449, CVS-2013-4232) 2013-08-14 05:11:36 +00:00
Frank Warmerdam
4e7465a311 initialize TIFFGetField() fetched values in tiffinfo.c 2013-07-10 00:44:22 +00:00
Tom Lane
96ceea8c8a Rewrite t2p_process_jpeg_strip(), to fix CVE-2013-1960. 2013-05-02 14:54:08 +00:00
Tom Lane
b6d66f9f30 Replace sprintf with snprintf, to fix CVE-2013-1961. 2013-05-02 14:44:29 +00:00
Tom Lane
feb6bd9f1d Sync tool usage printouts and man pages with reality. 2013-03-06 03:35:09 +00:00
Bob Friesenhahn
c204ef2a2f * tools/tiff2ps.c:Fix bug in auto rotate option code. Once a
rotation angle was set by the auto rotate check, it was retained
for all pages that followed instead of being retested for each
page.  Patch by Richard Nolde.
2013-01-26 02:24:05 +00:00
Tom Lane
800527edd2 Improve previous patch for CVE-2012-4564. 2012-12-10 18:19:11 +00:00
Bob Friesenhahn
74295b7487 * tools/tiffset.c: tiffset now supports a -u option to unset a
tag.  Patch by Zach Baker. See
http://bugzilla.maptools.org/show_bug.cgi?id=2419
2012-12-04 03:02:37 +00:00
Bob Friesenhahn
281ba91d09 * automake: Update Automake to 1.12.5 release. 2012-11-18 18:08:31 +00:00
Frank Warmerdam
37671b36b9 fix zero size buffer exploit (CVE-2012-4564) in ppm2tiff 2012-11-02 05:13:24 +00:00
Bob Friesenhahn
f458c10308 * Makefile.am: Update to Automake 1.12.4 2012-09-20 13:50:27 +00:00
Bob Friesenhahn
ec5ce9c2b3 * Makefile.in: Update to Automake 1.12.3 2012-08-19 17:00:46 +00:00
Bob Friesenhahn
7d38024b8d * libtiff{tiff.h, tif_print.c, tif_dirinfo.c, tif_dirread.c}: Add
some TIFF/FX support in libtiff.  Add the tag definitions to
tiff.h.  Add the related TIFF field definitions to tif_dirinfo.c,
and also fixes an error in a comment.  Adds the photometric values
to tif_print.c, and fixes a bug.  These changes are by Steve
Underwood.

* libtiff/tif_write.c: Fix bug rewriting image tiles in a
2012-08-19 16:56:32 +00:00
Tom Lane
84595b4fd7 Add accessor functions for the opaque type TIFFField. 2012-07-29 15:45:29 +00:00
Tom Lane
73dec72e8a Fix a couple more tiff2pdf bugs. 2012-07-19 15:43:41 +00:00
Tom Lane
7e000dd360 In tiff2pdf.c, fail when TIFFSetDirectory() fails. 2012-07-18 15:07:55 +00:00
Frank Warmerdam
ee51ab00b3 ignore various windows intermediate files 2012-06-16 17:05:37 +00:00
Frank Warmerdam
0055471655 avoid some clang warnings 2012-06-15 21:51:54 +00:00
Tom Lane
f5077ed7ed Fix CVE-2012-2113 2012-06-15 21:44:31 +00:00
Frank Warmerdam
b246f148ff nicer way to avoid reading data for non-image directories 2012-06-06 06:05:29 +00:00
Frank Warmerdam
b3dadc7ff3 avoid reading imagery with -D in EXIF directories 2012-06-01 23:22:53 +00:00
Frank Warmerdam
920688aac5 avoid uninitialized variable for degenerate files 2012-05-24 03:50:31 +00:00
Bob Friesenhahn
d766e7c5a0 * Update automake used to 1.11.3. 2012-02-18 21:58:02 +00:00
Bob Friesenhahn
d338f7fe22 * configure.ac: Add libtiff private dependency on -llzma for
pkg-config.  Patch by Mark Brand.
Updated Automake to 1.11.2.
2011-12-22 17:03:48 +00:00
Bob Friesenhahn
cae87ed58a * tools/tiffsplit.c (tiffcp): TIFFGetField count field should be
uint32 type for TIFFTAG_JPEGTABLES.  Patch by Christophe
Deroulers.
2011-10-22 17:03:00 +00:00
Bob Friesenhahn
c51502913d * libtiff/tif_dirread.c (TIFFFetchStripThing): Free "data" also
upon failure to allocate "resizeddata".
* tools/tiff2ps.c (PSDataBW): Zero buffer *after* checking for
allocation failure, not before.
2011-05-31 17:10:18 +00:00
Bob Friesenhahn
d73e9e8b19 * tools/rgb2ycbcr.c (cvtRaster): unchecked malloc 2011-05-31 17:03:16 +00:00
Bob Friesenhahn
bd77483087 * libtiff/tif_jpeg.c, tools/tiff2pdf.c, tools/tiff2ps.c: mark
NULL-deref and possible overflow
2011-05-31 17:00:03 +00:00
Bob Friesenhahn
e66a15f97e * tools/tiff2pdf.c: remove decl+set of set-but-not-used local, "written" 2011-05-31 16:57:10 +00:00
Bob Friesenhahn
959042fdcf Fix spelling typo in tiff2ps. 2011-04-09 16:53:08 +00:00
Bob Friesenhahn
c546a4ccf8 * configure.ac: Should use AC_CANONICAL_HOST since host specifies
the run-time target whereas target is used to specify the final
output target if the package is a build tool (like a compiler),
which libtiff is not.  Resolves libtiff bug 2307 "Use
AC_CANONICAL_HOST macro".
2011-04-09 15:43:03 +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
Bob Friesenhahn
b69a1998be * libtiff/tif_ojpeg.c: Fixes to compile with MinGW32 GCC.
* 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.
2011-04-02 19:30:20 +00:00
Frank Warmerdam
a9a1d1c65f Add -d and -sd switches to tiffset to allow operation on a particular
directory instead of just the first (jef)
2011-03-26 12:07:20 +00:00
Frank Warmerdam
91479f4d42 avoid leaks if TIFFRGBAImageBegin() fails (#2295) 2011-02-23 21:46:09 +00:00
Andrey Kiselev
d499ffbfcd Added support for specifying the compression level parameter (preset) for
Deflate and LZMA encoders, e.g "-c lzma:p1" or "-c zip:p9".
2010-12-23 13:38:47 +00:00
Bob Friesenhahn
9f3e08cf94 Needed to add tif_lzma.c to the Makefile. 2010-12-18 16:30:15 +00:00
Lee Howard
cb405082bb * tools/gif2tiff.c: fix buffer overrun
http://bugzilla.maptools.org/show_bug.cgi?id=2270
2010-12-15 00:22:44 +00:00
Andrey Kiselev
1e3630f9fd Regenerate autotools stuff. 2010-12-14 12:54:53 +00:00
Andrey Kiselev
a2d72c2dd4 Implement a new TIFF compression scheme LZMA reserving a new value 34925 for
Compression tag. As per bug http://bugzilla.maptools.org/show_bug.cgi?id=2221
2010-12-14 12:52:59 +00:00
Lee Howard
630dc52808 * tools/fax2ps.c: be consistent with page-numbering
http://bugzilla.maptools.org/show_bug.cgi?id=2225
2010-12-14 03:16:45 +00:00
Lee Howard
d96a823670 * tools/tiffcrop.c: new release by Richard Nolde
http://bugzilla.maptools.org/show_bug.cgi?id=2004
2010-12-14 02:03:24 +00:00
Lee Howard
3cb55ee486 * tools/tiff2pdf.c: fix colors for images with RGBA
interleaved data
        http://bugzilla.maptools.org/show_bug.cgi?id=2250
2010-12-13 05:41:38 +00:00
Lee Howard
3c383d15fa * tools/tiff2pdf.c: remove invalid duplication for Lab
http://bugzilla.maptools.org/show_bug.cgi?id=2162
2010-12-12 06:58:26 +00:00
Lee Howard
9cf3b2cd4c * tools/fax2ps.c: replace unsafe tmpfile() with mkstemp()
http://bugzilla.maptools.org/show_bug.cgi?id=2118
2010-12-12 01:11:56 +00:00
Lee Howard
e70efefb35 * tools/tiff2pdf.c: add fill-page option
http://bugzilla.maptools.org/show_bug.cgi?id=2051
2010-12-11 22:47:49 +00:00
Lee Howard
046a69c47a * tools/tiffinfoce.c: strip byte counts are uint64* now 2010-12-11 19:33:48 +00:00
Lee Howard
22ea884fcd 2010-12-08 Lee Howard <faxguy@howardsilvan.com>
* libtiff/tif_ojpeg.c: fix crash when reading a TIFF with a zero
        or missing byte-count tag
        * tools/tiffsplit.c: abort when reading a TIFF without a byte-count
        per http://bugzilla.maptools.org/show_bug.cgi?id=1996
2010-12-11 19:16:47 +00:00
Lee Howard
b3c5153919 If it doesn't fail, then it succeeds. 2010-11-28 15:35:12 +00:00
Bob Friesenhahn
faf5f3ebae * libtiff-4.pc.in: Added libtiff pkg-config .pc file support.
Patch by Vincent Torri.
2010-11-27 20:54:51 +00:00
Lee Howard
01ff8dfe99 More improvements from Richard Nolde. 2010-11-26 23:26:46 +00:00
Frank Warmerdam
756ab12a5e various fixes for win32 porting 2010-10-21 19:07:32 +00:00
Lee Howard
4536beaed1 See: http://bugzilla.maptools.org/show_bug.cgi?id=1983
* tools/tiff2ps.c: improvements and enhancements from Richard Nolde
        with additional command line options for Document Title,
        Document Creator, and Page Orientation
2010-09-26 05:39:31 +00:00
Bob Friesenhahn
28d10ec5bd * tools/tiffcrop.c: Patch from Richard Nolde to avoid a
potentially unterminated buffer due to using an exceptionally long
file name.
2010-07-13 15:51:37 +00:00
Andrey Kiselev
548b403d10 Fixed ID buffer filling in t2p_write_pdf_trailer(), thanks to Dmitry V. Levin. 2010-07-08 09:37:52 +00:00
Andrey Kiselev
897e7e9491 Properly handle TIFFTAG_PAGENUMBER, TIFFTAG_HALFTONEHINTS,
TIFFTAG_YCBCRSUBSAMPLING, TIFFTAG_DOTRANGE which should be set by value.
2010-07-06 14:30:38 +00:00
Andrey Kiselev
a32e672131 Fix the count for WhitePoint tag as per bug
http://bugzilla.maptools.org/show_bug.cgi?id=2042
2010-07-02 12:02:56 +00:00
Andrey Kiselev
004e0bab6d Tiny formatting fixes to improve code navigation. 2010-07-02 11:06:29 +00:00
Andrey Kiselev
0cd06f1134 *** empty log message *** 2010-07-01 15:56:56 +00:00
Andrey Kiselev
5122fdb3e0 *** empty log message *** 2010-06-30 16:04:50 +00:00
Andrey Kiselev
5a48f5167f *** empty log message *** 2010-06-30 15:41:49 +00:00
Andrey Kiselev
f4eff24f63 *** empty log message *** 2010-06-30 14:12:03 +00:00
Andrey Kiselev
aa50cfd0aa *** empty log message *** 2010-06-25 12:24:13 +00:00
Bob Friesenhahn
e3538640b6 C files should not use C++ style comments. 2010-06-21 19:09:26 +00:00
Bob Friesenhahn
ee8700a596 * tools/tiffcrop.c: Patch from Richard Nolde. Reject YCbCr
subsampled data since tiffcrop currently doesn't support it.  Fix
JPEG support.
2010-06-16 01:54:48 +00:00
Frank Warmerdam
75f7f78120 various fixes for tiff2pdf (#2211) 2010-06-13 19:25:54 +00:00
Bob Friesenhahn
d30823e382 * tools/tiffcrop.c: Applied patch from Richard Nolde: Corrected
European page size dimensions.  Added an option to allow the user
to specify a custom page size on the command line.  Fix the case
where a page size specified with a fractional part was being
coerced to an integer by retyping the variables that define the
paper size.
2010-06-11 22:25:36 +00:00
Bob Friesenhahn
bbf76bce0f * tools/tiffcp.c (tiffcp): Applied Tom Lane's patch to reject
YCbCr subsampled data since tiffcp currently doesn't support it.
http://bugzilla.maptools.org/show_bug.cgi?id=2097
2010-06-11 21:23:12 +00:00
Bob Friesenhahn
d36017b938 * libtiff/tif_fax3.c (Fax3SetupState): Yesterday's fix for
CVE-2010-1411 was not complete.

* libtiff/tiffiop.h (TIFFSafeMultiply): New macro to safely
multiply two integers.  Returns zero if there is an integer
overflow.

* tools/tiffcp.c (main): tiffcp should not leak memory if an error
is reported when reading the input file.
2010-06-09 17:17:13 +00:00
Bob Friesenhahn
3adc33842b * Update libtool to version 2.2.8.
* libtiff/tif_fax3.c (Fax3SetupState): Avoid under-allocation of
buffer due to integer overflow in TIFFroundup() and several other
potential overflows.  In conjunction with the fix to TIFFhowmany(),
fixes CVE-2010-1411.

* libtiff/tiffiop.h (TIFFhowmany): Return zero if parameters would
result in an integer overflow. This causes TIFFroundup() to also
return zero if there would be an integer overflow.
2010-06-08 23:32:22 +00:00
Frank Warmerdam
13ab8a93b6 added -x switch to tiffcp to (re)number allt he pages (#2203) 2010-06-03 17:01:01 +00:00
Bob Friesenhahn
9319bd574a * libtiff/tif_dir.c (_TIFFVSetField): Add a special error case for
when the tag count value is zero.  Error handling is still a
regression since in 3.9.2, empty tags are skipped (with a warning)
rather than returning a hard error and refusing to read the file.

* tools/ppm2tiff.c (main): While case for parsing comment line
requires extra parenthesis to work as expected.  Reported by
Thomas Sinclair.
2010-04-10 19:22:34 +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
Lee Howard
d473b19b31 * libtiff/tif_jpeg.c: Do not generate a JPEGTables tag when creating
the JPEG TIFF as is is not required in order to prevent it from
        being unused and filled with invalid data.  (Leave it to be
        generated by later activity.)
        * tools/tiff2pdf.c: Write the JPEG SOI headers into the TIFF strip
        data rather than skipping them.  This fixes the ability to view in
        Acrobat Reader, Evince, and Ghostscript.
2010-02-22 19:10:07 +00:00
Frank Warmerdam
b7b6095407 fix resource leaks on error (#2125) 2009-11-30 18:42:53 +00:00
Bob Friesenhahn
444e4b4866 * tools/tiffcrop.c: Updated tiffcrop from Richard Nolde. This
version has undergone substantial testing with arbitrary sample
bit depths.  Also eliminates GCC compilation warnings.
2009-11-03 15:24:27 +00:00
Bob Friesenhahn
eecc3405f3 * tools/tiffcrop.c, man/tiffcrop.1: New tiffcrop from Richard
Nolde.  Major updates to add significant functionality for reading
and writing tile based images with bit depths not a multiple of 8
which cannot be handled by tiffcp.
2009-09-24 21:57:11 +00:00
Bob Friesenhahn
840cb0032f * tools/{tiffcrop.c,tiffgt.c}: Applied patch from Oden Eriksson to
fix build with gcc when using the "-Wformat
-Werror=format-security" flags.
2009-08-30 17:38:51 +00:00
Bob Friesenhahn
df3386927a * tools/tiffinfo.c: tiffinfo should return error status to the
caller.  Register a private error callback to accomplish that.
2009-08-28 23:46:56 +00:00
Bob Friesenhahn
614f95d8b1 * tools/{rgb2ycbcr.c, tiff2rgba.c}: Applied fixes for "Bug 2079 -
CVE-2009-2347 libtiff: integer overflows in various inter-color
space conversion tools".
http://bugzilla.maptools.org/show_bug.cgi?id=2079
2009-08-24 17:15:05 +00:00
Bob Friesenhahn
8297307011 * configure.ac: Updated autotools. Autoconf 2.64, Automake 1.11,
libtool 2.2.6.  Enabled support for silent build rules
(--enable-silent-rules or 'make V=0') and colorized tests.

* html/{index.html, v3.9.0.html}: Update for 3.9.0 release.
2009-08-20 22:57:38 +00:00
Frank Warmerdam
f4da7ed52e add -c sgilog to tiffcp, add minimal logluv testing 2009-06-30 17:25:26 +00:00
Frank Warmerdam
5d40e67e89 avoid defaulting image->res_unit to INCH in loadImage() 2009-02-06 15:43:06 +00:00
Frank Warmerdam
e238751e2d initialize xres/yres values in case missing in file 2009-01-23 06:04:31 +00:00
Frank Warmerdam
bb7dca71b3 include libport.h for getopt() prototype 2009-01-22 21:50:43 +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
Frank Warmerdam
01e6d4c022 tiffsplit.c: fix sampleformat to be shortv instead of longv 2009-01-21 04:42:10 +00:00
Bob Friesenhahn
506c21992e * test/tiffcrop.sh: New test script for tiffcrop from Richard
Nolde.

* tools/tiff2ps.c: Remove spurious message to stderr.
2009-01-12 16:23:11 +00:00
Bob Friesenhahn
d99686ccb2 * tools/tiff2ps.c: Incorporated significant functionality update
from Richard Nolde.  In particular, support for rotating the image
by 90, 180, 270, and 'auto' has been added.  Still waiting for
documentation patch to man/tiff2ps.1.

* man/tiffcrop.1: Incorporated documentation updates from Richard
Nolde.

* tools/tiffcrop.c: Incorporated significant functionality update
from Richard Nolde.
2009-01-11 20:04:22 +00:00
Bob Friesenhahn
953d02c32d * libtiff/tiffio.h: GCC will now validate format specifications
for TIFFError(), TIFFErrorExt(), TIFFWarning(), and
TIFFWarningExt() in order to reveal bugs.
* Many fixes throughout to work better as a 64-bit build.
2008-12-31 23:48:01 +00:00
Bob Friesenhahn
968401fdf3 * tools/{tiff2pdf.c, tiff2ps.c, tiffinfo.c}: Offset and length
tags now require 64-bit parameter rather than 32-bit.
* libtiff/tif_dirread.c: Fixed issues with unaligned access to
64-bit values.
2008-12-31 03:06:27 +00:00
Bob Friesenhahn
f44e642634 * tools/thumbnail.c: Eliminate crash noticed while running test
suite.
2008-12-30 22:20:35 +00:00
Bob Friesenhahn
527802616e * tools/tiffinfoce.c (main): Use toff_t for offset type when
retrieving offset of EXIF IFD.
2008-12-30 01:28:25 +00:00
Bob Friesenhahn
164884d67d Use toff_t rather than uint64 since it is a safer interface. 2008-12-30 00:12:11 +00:00
Bob Friesenhahn
dbd1873ffa * tools/tiffinfo.c (main): Offset to EXIF IFD requires a 64-bit
type now.  Fixes crash when dumping files containing an EXIF IFD.
* m4/libtool.m4: Update to libtool 2.2.6.
2008-12-29 23:44:18 +00:00
Frank Warmerdam
203fc17cb4 include tiffcrop 2008-12-13 15:23:15 +00:00
Andrey Kiselev
9498770c99 Use byte counts of proper size (uint64). Required for libtiff 4.0. 2008-09-05 07:06:26 +00:00
Andrey Kiselev
6ae8a4bd73 Use dynamically allocated array instead of static when constructing
output file names.
2008-09-05 06:44:32 +00:00
Andrey Kiselev
a1a53f9c74 Get rid of unsafe strcpy()/strcat() calls when doing the filename/path
construction.
2008-09-03 07:47:26 +00:00
Andrey Kiselev
3498398196 More appropriate format string in t2p_write_pdf_string(); avoid
signed/unsigned mismatch.
2008-09-03 07:35:25 +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
Frank Warmerdam
6e6e603753 fix some portability and warning issues with tiffcrop 2008-06-17 20:16:54 +00:00
Bob Friesenhahn
a4e657cc8a * test {tiff2pdf.sh tiff2ps-EPS1.sh tiff2ps-PS1.sh tiff2ps-PS2.sh
tiff2ps-PS3.sh tiffcp-g3-1d-fill.sh tiffcp-g3-1d.sh
tiffcp-g3-2d-fill.sh tiffcp-g3-2d.sh tiffcp-g3.sh tiffcp-g4.sh
tiffcp-split-join.sh tiffcp-split.sh tiffcp-thumbnail.sh
tiffdump.sh tiffinfo.sh}: Added more test scripts based on
suggestions from Lee Howard posted to the tiff list on 13 Sep
2007.
2008-05-24 22:24:25 +00:00
Frank Warmerdam
90c84b3440 major update from Richard Nolde (#1888) 2008-05-24 00:18:55 +00:00
Frank Warmerdam
8a241d9f11 avoid leaks, dead code 2008-05-23 19:52:49 +00:00
Frank Warmerdam
09fe8fabf4 fix some coverity reported problems 2008-05-23 17:24:41 +00:00
Frank Warmerdam
d4099b8eee update for 4.0.0beta1 release 2008-05-18 16:25:47 +00:00
Bob Friesenhahn
9015352474 * Makefile.am (ACLOCAL_AMFLAGS): Libtool 2.2.4 does not like
"ACLOCAL_AMFLAGS=-I ./m4".  It wants "ACLOCAL_AMFLAGS=-I m4".
2008-05-09 16:20:49 +00:00
Andrey Kiselev
33dbe6c262 Added support for MSVS 6.0. 2008-04-09 09:33:30 +00:00
Frank Warmerdam
e9cb45c2ee fix 64bit type issues 2008-01-07 15:47:54 +00:00
Frank Warmerdam
2e8e250054 Fix clean rules to be more precise, avoiding warnings from "del"
when running them after a full build.
2008-01-01 15:53:10 +00:00
Frank Warmerdam
41feaacb78 Fix 64-bit warnings when compiling under MSVC 2005 (x64). 2008-01-01 15:49:00 +00:00
Frank Warmerdam
bee6b8237d Changes to reflect the fact that TIFFFieldWithTag() and TIFFFieldWithName()
now return TIFFField pointers instead of TIFFFieldInfo pointers.
2008-01-01 15:46:28 +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
Frank Warmerdam
8e40470908 Fix problem with alpha setting 2007-10-05 16:30:18 +00:00
Bob Friesenhahn
2737e0e77b * test/images: Added a small collection of test images for use by
test programs and scripts.
* test/tiffinfo.sh: A trivial example test script.
* test/common.sh: Added small script for setting the environment
used by script-based tests.
2007-09-19 21:51:00 +00:00
Andrey Kiselev
42bed3384e libtiff 4.0.0alpha released. 2007-07-13 14:57:37 +00:00
Andrey Kiselev
612fe33e9d Mapping routines definitions fixed. 2007-07-12 17:32:53 +00:00
Andrey Kiselev
3716b22ae8 Added missed extern optind. 2007-07-12 17:25:12 +00:00
Bob Friesenhahn
b2328c5b5d * libtiff/tif_stream.cxx: Adapt to use toff_t again. Update to
use standard C++ library size types and attempt to detect overflow
cases.
2007-07-11 20:27:14 +00:00
Bob Friesenhahn
de5235e3af * tools/tiff2pdf.c: Fix a compile problem when JPEG_SUPPORT is not
defined.
2007-07-06 01:25:11 +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
Andrey Kiselev
bf903e0588 Added support 16-bit images as per bug
http://bugzilla.remotesensing.org/show_bug.cgi?id=1566
Patch from William Bader.
2007-07-03 16:00:53 +00:00
Andrey Kiselev
9a19c1e905 Fix for TIFFTAG_JPEGTABLES tag fetching and significant upgrade of the whole
utility as per bug http://bugzilla.remotesensing.org/show_bug.cgi?id=1560
Now we don't need tiffiop.h in tiff2pdf anymore and will open output PDF file
using TIFFClientOpen() machinery as it is implemented by Leon Bottou.
2007-07-03 15:47:05 +00:00
Andrey Kiselev
f14d1a5636 All makefile templates regenerated. 2007-06-27 12:03:37 +00:00
Bob Friesenhahn
671e370838 Added support for a TIFF_PTRDIFF_T type to use when doing pointer arithmetic. 2007-06-26 20:05:33 +00:00
Bob Friesenhahn
71b780383f Hopefully fixed botched upgrade of libtool. 2007-06-26 16:38:43 +00:00
Bob Friesenhahn
8c4398d0d6 * port/strtoull.c: New porting function in case strtoull() is not
available on the target system.
* configure.ac: Add configure support for determining sized types
in a portable way and performing necessary substitutions in
tif_config.h and tiffconf.h.  Updated tiff.h to use the new
definitions.
2007-06-25 15:38:21 +00:00
Joris Van Damme
70b42a0259 BigTIFF upgrade: tiffcp.c 2007-06-20 08:36:42 +00:00
Joris Van Damme
4bd2d780ce BigTIFF upgrade: tiffcp.c 2007-06-20 08:35:57 +00:00
Joris Van Damme
78faf04967 BigTIFF upgrade: tiff2rgba.c (last minute correction) 2007-06-13 14:21:59 +00:00
Joris Van Damme
140aefa242 BigTIFF upgrade: tiff2rgba.c 2007-06-13 14:14:03 +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
Joris Van Damme
6696d959b5 BigTIFF upgrade: tiffinfo.c 2007-06-12 13:08:09 +00:00
Andrey Kiselev
85cec3b0a7 Check the tmpfile() return status as per bug
http://bugzilla.remotesensing.org/show_bug.cgi?id=154
2007-04-27 16:47:14 +00:00
Andrey Kiselev
d47a85ce37 Avoid warnings. 2007-04-18 08:46:33 +00:00
Andrey Kiselev
dc8ae28aa2 Significant update in functionsality as per bug
http://bugzilla.remotesensing.org/show_bug.cgi?id=1525
2007-04-06 14:23:54 +00:00
Andrey Kiselev
c29dea9440 Properly handle tags with TIFF_VARIABLE writecount. As per bug
http://bugzilla.remotesensing.org/show_bug.cgi?id=1350
2007-02-24 17:14:14 +00:00
Andrey Kiselev
c4f2e5b44e Do not assume inches when the resolution units do not specified. As per bug
http://bugzilla.remotesensing.org/show_bug.cgi?id=1366
2007-02-24 16:28:48 +00:00
Andrey Kiselev
db88776e03 Do not change RowsPerStrip value if it was set as infinite. As per bug:
http://bugzilla.remotesensing.org/show_bug.cgi?id=1368
2007-02-24 15:57:01 +00:00
Andrey Kiselev
e82a93e642 Use strchr() instead of index(); avoid warnings. 2007-02-24 15:27:15 +00:00
Andrey Kiselev
2ad35de456 Added tiffcrop utility. 2007-02-24 15:26:09 +00:00
Andrey Kiselev
ef833c655f Regenerated. 2007-02-24 15:03:47 +00:00
Andrey Kiselev
bddf26622c New. 2007-02-24 14:48:01 +00:00
Andrey Kiselev
c0123c7895 This utility does not work properly on big-endian architectures. It was fixed
including the bug http://bugzilla.remotesensing.org/show_bug.cgi?id=1149
2007-01-31 14:46:59 +00:00
Andrey Kiselev
7fd8cdbe99 Attempt to fix bug http://bugzilla.remotesensing.org/show_bug.cgi?id=1149 2007-01-27 18:38:34 +00:00
Mateusz Loskot
367a35efb3 TIFF library ported to Windows CE platform. 2007-01-15 18:40:39 +00:00
Andrey Kiselev
c905dc9878 tiffset.exe added to the list of utilities to be build. 2006-10-13 11:06:07 +00:00
Andrey Kiselev
576c461a28 Get rid of BSD integer types as per bug
http://bugzilla.remotesensing.org/show_bug.cgi?id=1319
2006-10-13 10:26:56 +00:00
Frank Warmerdam
06ab41916f Fix handling of -q values. (bug 587) 2006-06-19 20:12:07 +00:00
Andrey Kiselev
5a80b5f42e Fixed floating point comparison logic as per bug
http://bugzilla.remotesensing.org/show_bug.cgi?id=1191
2006-06-08 11:52:27 +00:00
Andrey Kiselev
3c3ae7d37c More fixes for character type safety. 2006-06-08 11:27:11 +00:00
Andrey Kiselev
a0fdd6eb0c Fixed buffer overflow condition in t2p_write_pdf_string() as per bug
http://bugzilla.remotesensing.org/show_bug.cgi?id=1196
2006-06-08 10:45:35 +00:00
Andrey Kiselev
01a173d4b8 Added help line for 'jbig' compression option. 2006-06-07 16:34:32 +00:00
Andrey Kiselev
514fb56f86 Regenerated. 2006-06-07 15:55:20 +00:00
Andrey Kiselev
9ff07be06c Added support for JBIG compression scheme (34661 code) contributed by Lee
Howard. As per bug http://bugzilla.remotesensing.org/show_bug.cgi?id=896
2006-06-07 15:47:43 +00:00
Bob Friesenhahn
56f599add1 * libtiff/{tif_dirinfo.c, tif_print.c} : Fix crash in
TIFFPrintDirectory().  Joris Van Damme authored the fix.
2006-06-03 15:28:29 +00:00
Andrey Kiselev
f7035cc549 Unified line ending characters (always use '\n') as per bug
http://bugzilla.remotesensing.org/show_bug.cgi?id=1163
2006-04-21 15:09:34 +00:00
Andrey Kiselev
550cfd7a32 Properly set the binary mode for stdin stream as per bug
http://bugzilla.remotesensing.org/show_bug.cgi?id=1141
2006-04-20 12:36:23 +00:00
Andrey Kiselev
e3fe101bf5 Fixed typos as per bug http://bugzilla.remotesensing.org/show_bug.cgi?id=1139 2006-04-20 12:04:35 +00:00
Andrey Kiselev
b90b47e6f7 libtiff 3.8.2 released. 2006-03-23 14:54:00 +00:00
Andrey Kiselev
bd5bff3cf6 Use runtime paths linker flags when rpath option enabled. 2006-03-23 14:23:43 +00:00
Andrey Kiselev
fb8fe4b17f Makefiles improvements as per bug
http://bugzilla.remotesensing.org/show_bug.cgi?id=1128
2006-03-21 16:41:07 +00:00
Andrey Kiselev
bc6736f91d Fixed win32 I/O functions usage as per bug
http://bugzilla.remotesensing.org/show_bug.cgi?id=1127
2006-03-21 16:37:51 +00:00
Andrey Kiselev
b5a9d9642e Do not set RowsPerStrip bigger than image length. 2006-03-21 16:24:33 +00:00
Andrey Kiselev
ee7446ab86 Avoid warnings. 2006-03-20 15:29:53 +00:00
Andrey Kiselev
08300a98ec Fixed wrong TIFFerror() invocations as per bug
http://bugzilla.remotesensing.org/show_bug.cgi?id=1125
2006-03-17 14:58:57 +00:00
Andrey Kiselev
9ebb2b1a85 Fixed reading the input stream from stdin as per bug
http://bugzilla.remotesensing.org/show_bug.cgi?id=1124
2006-03-17 14:56:42 +00:00