v4.0.4beta.html 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  2. <HTML>
  3. <HEAD>
  4. <TITLE>
  5. Changes in TIFF v4.0.4beta
  6. </TITLE>
  7. </HEAD>
  8. <BODY BGCOLOR=white>
  9. <FONT FACE="Helvetica, Arial, Sans">
  10. <BASEFONT SIZE=4>
  11. <B><FONT SIZE=+3>T</FONT>IFF <FONT SIZE=+2>C</FONT>HANGE <FONT SIZE=+2>I</FONT>NFORMATION</B>
  12. <BASEFONT SIZE=3>
  13. <UL>
  14. <HR SIZE=4 WIDTH=65% ALIGN=left>
  15. <B>Current Version</B>: v4.0.4beta<BR>
  16. <B>Previous Version</B>: <A HREF=v4.0.3.html>v4.0.3</a><BR>
  17. <B>Master Download Site</B>: <A HREF="https://download.osgeo.org/libtiff">
  18. download.osgeo.org</a>, directory pub/libtiff</A><BR>
  19. <B>Master HTTP Site</B>: <A HREF="http://www.simplesystems.org/libtiff/">
  20. http://www.simplesystems.org/libtiff/</a>
  21. <HR SIZE=4 WIDTH=65% ALIGN=left>
  22. </UL>
  23. <P>
  24. This document describes the changes made to the software between the
  25. <I>previous</I> and <I>current</I> versions (see above). If you don't
  26. find something listed here, then it was not done in this timeframe, or
  27. it was not considered important enough to be mentioned. The following
  28. information is located here:
  29. <UL>
  30. <LI><A HREF="#highlights">Major Changes</A>
  31. <LI><A HREF="#configure">Changes in the software configuration</A>
  32. <LI><A HREF="#libtiff">Changes in libtiff</A>
  33. <LI><A HREF="#tools">Changes in the tools</A>
  34. <LI><A HREF="#contrib">Changes in the contrib area</A>
  35. </UL>
  36. <p>
  37. <P><HR WIDTH=65% ALIGN=left>
  38. <!--------------------------------------------------------------------------->
  39. <A NAME="highlights"><B><FONT SIZE=+3>M</FONT>AJOR CHANGES:</B></A>
  40. <UL>
  41. <li> None
  42. </UL>
  43. <P><HR WIDTH=65% ALIGN=left>
  44. <!--------------------------------------------------------------------------->
  45. <A NAME="configure"><B><FONT SIZE=+3>C</FONT>HANGES IN THE SOFTWARE CONFIGURATION:</B></A>
  46. <UL>
  47. <li> Updated to use Automake 1.15 and Libtool 2.4.5
  48. </UL>
  49. <P><HR WIDTH=65% ALIGN=left>
  50. <!--------------------------------------------------------------------------->
  51. <A NAME="libtiff"><B><FONT SIZE=+3>C</FONT>HANGES IN LIBTIFF:</B></A>
  52. <UL>
  53. <li> TIFFCheckDirOffset(): avoid uint16 overflow
  54. when reading more than 65535 directories, and effectively error out when
  55. eaching that limit.
  56. <li> TIFFNumberOfDirectories(): generate error in case of directory count
  57. overflow.
  58. <li> TIFFAdvanceDirectory(): If nextdir is found to
  59. be defective, then set it to zero before returning error in order
  60. to terminate processing of truncated TIFF.
  61. <li> JPEG-in-TIFF: recognize SOF2, SOF9 and SOF10
  62. markers to avoid emitting a warning. Fix for compatibility with mozjpeg library.
  63. Note: the default settings of mozjpeg will produce progressive scans, which
  64. is forbidden by the TechNote.
  65. <li> JPEG-in-TIFF: Fix regression introduced in 3.9.3/4.0.0 that caused
  66. all tiles/strips to include quantization tables even when the jpegtablesmode
  67. had the JPEGTABLESMODE_QUANT bit set.
  68. Also add explicit removal of Huffman tables when jpegtablesmode has the
  69. JPEGTABLESMODE_HUFF bit set, which avoids Huffman tables to be emitted in the
  70. first tile/strip (only useful in update scenarios. create-only was
  71. fine)
  72. <li> JPEG-in-TIFF: fix segfault in JPEGFixupTagsSubsampling() on
  73. corrupted image where tif->tif_dir.td_stripoffset == NULL.
  74. (<a href="http://bugzilla.maptools.org/show_bug.cgi?id=2471">#2471</a>)
  75. <li> NeXT codec: add new tests to check that we don't read outside of
  76. the compressed input stream buffer.
  77. <li> NeXT codec: check that BitsPerSample = 2. Fixes
  78. <a href="http://bugzilla.maptools.org/show_bug.cgi?id=2487">#2487</a> (CVE-2014-8129)
  79. <li> NeXT codec: in the "run mode", use tilewidth for tiled images
  80. instead of imagewidth to avoid crash
  81. <li> tif_getimage.c: in OJPEG case, fix checks on strile width/height
  82. in the putcontig8bitYCbCr42tile, putcontig8bitYCbCr41tile and
  83. putcontig8bitYCbCr21tile cases.
  84. <li> in TIFFDefaultDirectory(), reset any already existing
  85. extended tags installed by user code through the extender mechaninm before
  86. calling the extender callback (GDAL #5054)
  87. <li> Fix warnings about unused parameters.
  88. <li> Fix various typos in comments found by Debian lintian tool (GDAL #5756)
  89. <li> tif_getimage.c: avoid divide by zero on invalid YCbCr subsampling.
  90. (<a href="http://bugzilla.maptools.org/show_bug.cgi?id=2235">#2235</a>)
  91. <li> tif_dirread.c: In EstimateStripByteCounts(), check return code
  92. of _TIFFFillStriles(). This solves crashing bug on corrupted
  93. images generated by afl.
  94. <li>tif_read.c: fix several invalid comparisons of a uint64 value with
  95. &lt;= 0 by casting it to int64 first. This solves crashing bug on corrupted
  96. images generated by afl.
  97. <li>TIFFSetField(): refuse to set negative values for
  98. TIFFTAG_XRESOLUTION and TIFFTAG_YRESOLUTION that cause asserts when writing
  99. the directory
  100. <li>TIFFReadDirectory(): refuse to read ColorMap or
  101. TransferFunction if BitsPerSample has not yet been read, otherwise reading
  102. it later will cause user code to crash if BitsPerSample > 1
  103. <li> TIFFRGBAImageOK(): return FALSE if LOGLUV with
  104. SamplesPerPixel != 3, or if CIELAB with SamplesPerPixel != 3 or BitsPerSample != 8
  105. <li> tif_config.vc.h: no longer use "#define snprintf _snprintf" with
  106. Visual Studio 2015 aka VC 14 aka MSVC 1900
  107. <li> LZW codec: prevent potential null dereference of sp->dec_codetab in LZWPreDecode
  108. (<a href="http://bugzilla.maptools.org/show_bug.cgi?id=2459">#2459</a>)
  109. <li> TIFFReadBufferSetup(): avoid passing -1 size
  110. to TIFFmalloc() if passed user buffer size is 0
  111. (<a href="http://bugzilla.maptools.org/show_bug.cgi?id=2459">#2459</a>)
  112. <li> TIFFReadDirEntryOutputErr(): Incorrect
  113. count for tag should be a warning rather than an error since
  114. errors terminate processing.
  115. <li> tif_dirinfo.c (TIFFField) : Fix data type for TIFFTAG_GLOBALPARAMETERSIFD tag.
  116. <li> Add definitions for TIFF/EP CFARepeatPatternDim and CFAPattern tags
  117. (<a href="http://bugzilla.maptools.org/show_bug.cgi?id=2457">#2457</a>)
  118. <li> tif_codec.c, tif_dirinfo.c: Enlarge some fixed-size buffers that weren't
  119. large enough, and eliminate substantially all uses of sprintf(buf,
  120. ...) in favor of using snprintf(buf, sizeof(buf), ...)
  121. <li> configure.ac: Improve pkg-config static linking by adding -lm to Libs.private when needed.
  122. <li> tif_write.c: tmsize_t related casting warning fixed for
  123. 64bit linux.
  124. <li> tif_read.c: uint64/tmsize_t change for MSVC warnings.
  125. (<a href="http://bugzilla.maptools.org/show_bug.cgi?id=2427">#2427</a>)
  126. <li> Fix TIFFPrintDirectory's handling of
  127. field_passcount fields: it had the TIFF_VARIABLE and
  128. TIFF_VARIABLE2 cases backwards.
  129. <li> PixarLog codec: Improve previous patch for CVE-2012-4447
  130. (to enlarge tbuf for possible partial stride at end) so that
  131. overflow in the integer addition is detected.
  132. <li>tif_{unix,vms,win32}.c (_TIFFmalloc): ANSI C does not
  133. require malloc() to return NULL pointer if requested allocation
  134. size is zero. Assure that _TIFFmalloc does.
  135. <li>tif_zip.c: Avoid crash on NULL error messages.
  136. </UL>
  137. <P><HR WIDTH=65% ALIGN=left>
  138. <!-------------------------------------------------------------------------->
  139. <A NAME="tools"><B><FONT SIZE=+3>C</FONT>HANGES IN THE TOOLS:</B></A>
  140. <UL>
  141. <li> tiff2pdf: Fis various crashes and memory buffer access errors (oCERT-2014-013).
  142. <li> tiff2pdf: fix buffer overflow on some YCbCr JPEG compressed images.
  143. (<a href="http://bugzilla.maptools.org/show_bug.cgi?id=2445">#2445</a>)
  144. <li> tiff2pdf: fix buffer overflow on YCbCr JPEG compressed image.
  145. (<a href="http://bugzilla.maptools.org/show_bug.cgi?id=2443">#2443</a>)
  146. <li> tiff2pdf: check return code of TIFFGetField() when reading TIFFTAG_SAMPLESPERPIXEL
  147. <li> tiff2pdf: fix crash due to invalid tile count.
  148. <li> tiff2pdf: Detect invalid settings of BitsPerSample/SamplesPerPixel for CIELAB / ITULAB
  149. <li> tiff2pdf: Assure that memory size calculations for
  150. _TIFFmalloc() do not overflow the range of tmsize_t.
  151. <li> tiff2pdf: Avoid crash when TIFFTAG_TRANSFERFUNCTION tag returns one channel,
  152. with the other two channels set to NULL.
  153. <li> tiff2pdf: close PDF file. (<a href="http://bugzilla.maptools.org/show_bug.cgi?id=2479">#2479</a>)
  154. <li> tiff2pdf: Preserve input file directory order when pages
  155. are tagged with the same page number.
  156. <li> tiff2pdf.c: terminate after failure of allocating ycbcr buffer
  157. (<a href="http://bugzilla.maptools.org/show_bug.cgi?id=2449">#2449</a> CVE-2013-4232)
  158. <li> tiff2pdf: Rewrite JPEG marker parsing in
  159. t2p_process_jpeg_strip to be at least marginally competent. The
  160. approach is still fundamentally flawed, but at least now it won't
  161. stomp all over memory when given bogus input. Fixes CVE-2013-1960.
  162. <li> tiffdump: Guard against arithmetic overflow when calculating allocation buffer sizes.
  163. <li> tiffdump: fix crash due to overflow of entry count.
  164. <li> tiffdump: Fix double-free bug.
  165. <li> tiffdump: detect cycle in TIFF directory chaining.
  166. (<a href="http://bugzilla.maptools.org/show_bug.cgi?id=2463">#2463</a>)
  167. <li> tiffdump: avoid passing a NULL pointer to read() if seek() failed before.
  168. (<a href="http://bugzilla.maptools.org/show_bug.cgi?id=2459">#2459</a>)
  169. <li> tiff2bw: when Photometric=RGB, the utility only works if SamplesPerPixel = 3. Enforce that.
  170. (<a href="http://bugzilla.maptools.org/show_bug.cgi?id=2485">#2485</a>, CVE-2014-8127)
  171. <li> pal2rgb, thumbnail: fix crash by disabling TIFFTAG_INKNAMES copying.
  172. (<a href="http://bugzilla.maptools.org/show_bug.cgi?id=2484">#2484</a>, CVE-2014-8127)
  173. <li> thumbnail: fix out-of-buffer write.
  174. (<a href="http://bugzilla.maptools.org/show_bug.cgi?id=2489">#2489</a>, CVE-2014-8128)
  175. <li> thumbnail, tiffcmp: only read/write TIFFTAG_GROUP3OPTIONS
  176. or TIFFTAG_GROUP4OPTIONS if compression is COMPRESSION_CCITTFAX3 or
  177. COMPRESSION_CCITTFAX4.
  178. (<a href="http://bugzilla.maptools.org/show_bug.cgi?id=2493">#2493</a>, CVE-2014-8128)
  179. <li> tiffcp: fix crash when converting YCbCr JPEG-compressed to none.
  180. (<a href="http://bugzilla.maptools.org/show_bug.cgi?id=2480">#2480</a>)
  181. <li> bmp2tiff: fix crash due to int overflow related to input BMP dimensions
  182. <li> tiffcrop: fix crash due to invalid TileWidth/TileHeight
  183. <li> tiffcrop: fix segfault if bad value passed to -Z option
  184. ( <a href="http://bugzilla.maptools.org/show_bug.cgi?id=2459">#2459</a>)
  185. and add missing va_end in dump_info
  186. <li> thumbnail, tiffcrop: "fix" heap read over-run found with
  187. Valgrind and Address Sanitizer on test suite
  188. <li> fax2ps: check malloc()/realloc() result. (<a href="http://bugzilla.maptools.org/show_bug.cgi?id=2470">#2470</a>)
  189. <li> gif2tiff: apply patch for CVE-2013-4243. (<a href="http://bugzilla.maptools.org/show_bug.cgi?id=2451">#2451</a>)
  190. <li> gif2tiff: fix possible OOB write. (<a href="http://bugzilla.maptools.org/show_bug.cgi?id=2452">#2452</a>, CVE-2013-4244)
  191. <li> gif2tiff: Be more careful about corrupt or hostile input files (<a href="http://bugzilla.maptools.org/show_bug.cgi?id=2450">#2450</a>, CVE-2013-4231)
  192. <li> tiff2rgba: fix usage message in that zip was wrongly described
  193. <li> tiffinfo: Default various values fetched with TIFFGetField() to avoid being uninitialized.
  194. <li> tiff2ps: Fix bug in auto rotate option code.
  195. <li> ppm2tiff: avoid zero size buffer vulnerability (CVE-2012-4564).
  196. check the linebytes calculation too, get the max() calculation
  197. straight, avoid redundant error messages, check for malloc
  198. failure.
  199. <li> tiffset: now supports a -u option to unset a tag.
  200. (<a href="http://bugzilla.maptools.org/show_bug.cgi?id=2419">#2419</a>)
  201. <li> Fix warnings about unused parameters.
  202. <li> rgb2ycbcr, tiff2bw, tiff2pdf, tiff2ps, tiffcrop, tiffdither :
  203. Enlarge some fixed-size buffers that weren't
  204. large enough, and eliminate substantially all uses of sprintf(buf,
  205. ...) in favor of using snprintf(buf, sizeof(buf), ...), so as to
  206. protect against overflow of fixed-size buffers. This responds in
  207. particular to CVE-2013-1961 concerning overflow in tiff2pdf.c's
  208. t2p_write_pdf_page().
  209. <li>html/man/tiff2ps.1.html, html/man/tiffcp.1.html,
  210. html/man/tiffdither.1.html, man/tiff2ps.1, man/tiffcp.1,
  211. man/tiffdither.1, tools/tiff2ps.c, tools/tiffcp.c,
  212. tools/tiffdither.c: Sync tool usage printouts and man pages with
  213. reality
  214. </UL>
  215. <P><HR WIDTH=65% ALIGN=left>
  216. <!--------------------------------------------------------------------------->
  217. <A NAME="contrib"><B><FONT SIZE=+3>C</FONT>HANGES IN THE CONTRIB AREA:</B></A>
  218. <UL>
  219. <li> Fix warnings about variables set but not used.
  220. <li> contrib/dbs/xtiff/xtiff.c: Enlarge some fixed-size buffers that weren't
  221. large enough, and eliminate substantially all uses of sprintf(buf,
  222. ...) in favor of using snprintf(buf, sizeof(buf), ...), so as to
  223. protect against overflow of fixed-size buffers.
  224. </UL>
  225. Last updated $Date: 2016-09-25 20:05:47 $.
  226. </BODY>
  227. </HTML>