22916341 move libjpeg from desktop to userland
authorNiveditha Rau <Niveditha.Rau@Oracle.COM>
Thu, 17 Mar 2016 08:44:16 -0700
changeset 5622 b0275c75884a
parent 5619 4d97a998cbcc
child 5623 76c8f872fb8f
22916341 move libjpeg from desktop to userland 22916316 move libtiff from desktop to userland 22916330 move libpng from desktop to userland 22890827 Tiff man pages are incorrectly installed under /usr/share/man/man3 directory. 15600516 libjpeg manpage should not provide pointers to documents that don't exist 15545272 man pages errors (libpng and libjpeg)
components/desktop/libjpeg/Makefile
components/desktop/libjpeg/files/libjpeg.3
components/desktop/libjpeg/libjpeg.license
components/desktop/libjpeg/libjpeg.p5m
components/desktop/libjpeg/patches/libjpg-01-makefile.cfg.patch
components/desktop/libjpeg/test/results-all.master
components/desktop/libpng/Makefile
components/desktop/libpng/files/png.4
components/desktop/libpng/libpng.license
components/desktop/libpng/libpng.p5m
components/desktop/libpng/patches/libpng10-libpng12-CVE-2014-9495-CVE-2015-0973.patch_2
components/desktop/libpng/patches/libpng14-CVE-2014-9495-CVE-2015-0973.patch
components/desktop/libpng/test/results-all.master
components/desktop/libtiff/Makefile
components/desktop/libtiff/libtiff.license
components/desktop/libtiff/libtiff.p5m
components/desktop/libtiff/patches/test-driver.patch
components/desktop/libtiff/patches/tiff-01-CVE-2013-1961.patch
components/desktop/libtiff/patches/tiff-02-CVE-2013-1960.patch
components/desktop/libtiff/patches/tiff-03-CVE-2012-4564.patch
components/desktop/libtiff/patches/tiff-04-CVE-2013-4231.patch
components/desktop/libtiff/patches/tiff-05-CVE-2013-4232.patch
components/desktop/libtiff/patches/tiff-06-CVE-2013-4243-CVE-2013-4244.patch
components/desktop/libtiff/patches/tiff-07-CVE-2015-1547-CVE-2014-9655.patch
components/desktop/libtiff/patches/tiff-08-CVE-2014-9330.patch
components/desktop/libtiff/test/results-all.master
components/meta-packages/incorporation-cache
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/desktop/libjpeg/Makefile	Thu Mar 17 08:44:16 2016 -0700
@@ -0,0 +1,73 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+#
+
+COMPILER =	gcc
+
+include ../../../make-rules/shared-macros.mk
+
+COMPONENT_NAME=         jpeg
+COMPONENT_VERSION=      6.0.2
+HUMAN_VERSION=          v6b
+COMPONENT_PROJECT_URL=  https://sourceforge.net/projects/libjpeg/
+COMPONENT_SRC=          jpeg-6b
+COMPONENT_SRC_NAME=     jpegsrc.$(HUMAN_VERSION)
+COMPONENT_ARCHIVE=      $(COMPONENT_SRC_NAME).tar.gz
+COMPONENT_ARCHIVE_HASH= \
+    sha256:75c3ec241e9996504fe02a9ed4d12f16b74ade713972f3db9e65ce95cd27e35d
+COMPONENT_ARCHIVE_URL=  $(COMPONENT_PROJECT_URL)files/libjpeg/6b/$(COMPONENT_ARCHIVE)
+COMPONENT_BUGDB=	library/libjpeg
+
+TPNO=			9298
+
+include $(WS_MAKE_RULES)/prep.mk
+include $(WS_MAKE_RULES)/configure.mk
+include $(WS_MAKE_RULES)/ips.mk
+
+LDFLAGS +=		$(CC_BITS)
+
+CONFIGURE_OPTIONS +=	--prefix=$(PROTO_DIR)/usr
+CONFIGURE_OPTIONS +=	--enable-shared
+CONFIGURE_OPTIONS +=	LDFLAGS="$(LDFLAGS)"
+
+COMPONENT_INSTALL_ARGS +=	INSTALL_DATA="ginstall -D"
+COMPONENT_INSTALL_ARGS +=	INSTALL_LIB="ginstall -D"
+COMPONENT_INSTALL_ARGS +=	INSTALL_PROGRAM="ginstall -D"
+
+COMPONENT_TEST_MASTER = $(COMPONENT_TEST_RESULTS_DIR)/results-all.master
+
+ASLR_MODE =	$(ASLR_ENABLE)
+
+configure:	$(CONFIGURE_32_and_64)
+
+build:          $(BUILD_32_and_64)
+
+install:        $(INSTALL_32_and_64)
+
+test:           $(TEST_32_and_64)
+
+system-test:    $(SYSTEM_TESTS_NOT_IMPLEMENTED)
+
+REQUIRED_PACKAGES += shell/ksh93
+REQUIRED_PACKAGES += system/library
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/desktop/libjpeg/files/libjpeg.3	Thu Mar 17 08:44:16 2016 -0700
@@ -0,0 +1,20 @@
+'\" te
+.TH libjpeg 3 "06 Apr 2004" "SunOS 5.11" "C Library Functions"
+.SH "NAME"
+libjpeg \- image
+compression library
+.SH "SYNOPSIS"
+.PP
+\fBcc\fR [\fB\fIflag\fR\fR\&...] \fB\fIfile\fR\fR [\fB\fIlibrary\fR\fR\&...] -\fBljpeg\fR
+.SH "DESCRIPTION"
+.PP
+This package contains C software to implement JPEG image compression
+and decompression\&. JPEG is a standardized compression method for full-color
+and grayscale images\&.
+.SH "SEE ALSO"
+.PP
+\fBcjpeg\fR(1), \fBdjpeg\fR(1), \fBjpegtran\fR(1), \fBrdjpgcom\fR(1), \fBwrjpgcom\fR(1)
+.SH "NOTES"
+.PP
+This man page was originally written by the Independent JPEG Group\&.
+Updated by Breda McColgan, Sun Microsystems Inc\&., 2004\&.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/desktop/libjpeg/libjpeg.license	Thu Mar 17 08:44:16 2016 -0700
@@ -0,0 +1,392 @@
+Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved.
+
+README content (required to be distributed if any of the JPEG source code is distributed)
+--------------------------------------------------------------------------------
+
+
+The Independent JPEG Group's JPEG software
+==========================================
+
+README for release 6b of 27-Mar-1998
+====================================
+
+This distribution contains the sixth public release of the Independent JPEG
+Group's free JPEG software.  You are welcome to redistribute this software and
+to use it for any purpose, subject to the conditions under LEGAL ISSUES, below.
+
+Serious users of this software (particularly those incorporating it into
+larger programs) should contact IJG at [email protected] to be added to
+our electronic mailing list.  Mailing list members are notified of updates
+and have a chance to participate in technical discussions, etc.
+
+This software is the work of Tom Lane, Philip Gladstone, Jim Boucher,
+Lee Crocker, Julian Minguillon, Luis Ortiz, George Phillips, Davide Rossi,
+Guido Vollbeding, Ge' Weijers, and other members of the Independent JPEG
+Group.
+
+IJG is not affiliated with the official ISO JPEG standards committee.
+
+
+DOCUMENTATION ROADMAP
+=====================
+
+This file contains the following sections:
+
+OVERVIEW            General description of JPEG and the IJG software.
+LEGAL ISSUES        Copyright, lack of warranty, terms of distribution.
+REFERENCES          Where to learn more about JPEG.
+ARCHIVE LOCATIONS   Where to find newer versions of this software.
+RELATED SOFTWARE    Other stuff you should get.
+FILE FORMAT WARS    Software *not* to get.
+TO DO               Plans for future IJG releases.
+
+Other documentation files in the distribution are:
+
+User documentation:
+  install.doc       How to configure and install the IJG software.
+  usage.doc         Usage instructions for cjpeg, djpeg, jpegtran,
+                    rdjpgcom, and wrjpgcom.
+  *.1               Unix-style man pages for programs (same info as usage.doc).
+  wizard.doc        Advanced usage instructions for JPEG wizards only.
+  change.log        Version-to-version change highlights.
+Programmer and internal documentation:
+  libjpeg.doc       How to use the JPEG library in your own programs.
+  example.c         Sample code for calling the JPEG library.
+  structure.doc     Overview of the JPEG library's internal structure.
+  filelist.doc      Road map of IJG files.
+  coderules.doc     Coding style rules --- please read if you contribute code.
+
+Please read at least the files install.doc and usage.doc.  Useful information
+can also be found in the JPEG FAQ (Frequently Asked Questions) article.  See
+ARCHIVE LOCATIONS below to find out where to obtain the FAQ article.
+
+If you want to understand how the JPEG code works, we suggest reading one or
+more of the REFERENCES, then looking at the documentation files (in roughly
+the order listed) before diving into the code.
+
+
+OVERVIEW
+========
+
+This package contains C software to implement JPEG image compression and
+decompression.  JPEG (pronounced "jay-peg") is a standardized compression
+method for full-color and gray-scale images.  JPEG is intended for compressing
+"real-world" scenes; line drawings, cartoons and other non-realistic images
+are not its strong suit.  JPEG is lossy, meaning that the output image is not
+exactly identical to the input image.  Hence you must not use JPEG if you
+have to have identical output bits.  However, on typical photographic images,
+very good compression levels can be obtained with no visible change, and
+remarkably high compression levels are possible if you can tolerate a
+low-quality image.  For more details, see the references, or just experiment
+with various compression settings.
+
+This software implements JPEG baseline, extended-sequential, and progressive
+compression processes.  Provision is made for supporting all variants of these
+processes, although some uncommon parameter settings aren't implemented yet.
+For legal reasons, we are not distributing code for the arithmetic-coding
+variants of JPEG; see LEGAL ISSUES.  We have made no provision for supporting
+the hierarchical or lossless processes defined in the standard.
+
+We provide a set of library routines for reading and writing JPEG image files,
+plus two sample applications "cjpeg" and "djpeg", which use the library to
+perform conversion between JPEG and some other popular image file formats.
+The library is intended to be reused in other applications.
+
+In order to support file conversion and viewing software, we have included
+considerable functionality beyond the bare JPEG coding/decoding capability;
+for example, the color quantization modules are not strictly part of JPEG
+decoding, but they are essential for output to colormapped file formats or
+colormapped displays.  These extra functions can be compiled out of the
+library if not required for a particular application.  We have also included
+"jpegtran", a utility for lossless transcoding between different JPEG
+processes, and "rdjpgcom" and "wrjpgcom", two simple applications for
+inserting and extracting textual comments in JFIF files.
+
+The emphasis in designing this software has been on achieving portability and
+flexibility, while also making it fast enough to be useful.  In particular,
+the software is not intended to be read as a tutorial on JPEG.  (See the
+REFERENCES section for introductory material.)  Rather, it is intended to
+be reliable, portable, industrial-strength code.  We do not claim to have
+achieved that goal in every aspect of the software, but we strive for it.
+
+We welcome the use of this software as a component of commercial products.
+No royalty is required, but we do ask for an acknowledgement in product
+documentation, as described under LEGAL ISSUES.
+
+
+LEGAL ISSUES
+============
+
+In plain English:
+
+1. We don't promise that this software works.  (But if you find any bugs,
+   please let us know!)
+2. You can use this software for whatever you want.  You don't have to pay us.
+3. You may not pretend that you wrote this software.  If you use it in a
+   program, you must acknowledge somewhere in your documentation that
+   you've used the IJG code.
+
+In legalese:
+
+The authors make NO WARRANTY or representation, either express or implied,
+with respect to this software, its quality, accuracy, merchantability, or
+fitness for a particular purpose.  This software is provided "AS IS", and you,
+its user, assume the entire risk as to its quality and accuracy.
+
+This software is copyright (C) 1991-1998, Thomas G. Lane.
+All Rights Reserved except as specified below.
+
+Permission is hereby granted to use, copy, modify, and distribute this
+software (or portions thereof) for any purpose, without fee, subject to these
+conditions:
+(1) If any part of the source code for this software is distributed, then this
+README file must be included, with this copyright and no-warranty notice
+unaltered; and any additions, deletions, or changes to the original files
+must be clearly indicated in accompanying documentation.
+(2) If only executable code is distributed, then the accompanying
+documentation must state that "this software is based in part on the work of
+the Independent JPEG Group".
+(3) Permission for use of this software is granted only if the user accepts
+full responsibility for any undesirable consequences; the authors accept
+NO LIABILITY for damages of any kind.
+
+These conditions apply to any software derived from or based on the IJG code,
+not just to the unmodified library.  If you use our work, you ought to
+acknowledge us.
+
+Permission is NOT granted for the use of any IJG author's name or company name
+in advertising or publicity relating to this software or products derived from
+it.  This software may be referred to only as "the Independent JPEG Group's
+software".
+
+We specifically permit and encourage the use of this software as the basis of
+commercial products, provided that all warranty or liability claims are
+assumed by the product vendor.
+
+
+ansi2knr.c is included in this distribution by permission of L. Peter Deutsch,
+sole proprietor of its copyright holder, Aladdin Enterprises of Menlo Park, CA.
+ansi2knr.c is NOT covered by the above copyright and conditions, but instead
+by the usual distribution terms of the Free Software Foundation; principally,
+that you must include source code if you redistribute it.  (See the file
+ansi2knr.c for full details.)  However, since ansi2knr.c is not needed as part
+of any program generated from the IJG code, this does not limit you more than
+the foregoing paragraphs do.
+
+The Unix configuration script "configure" was produced with GNU Autoconf.
+It is copyright by the Free Software Foundation but is freely distributable.
+The same holds for its supporting scripts (config.guess, config.sub,
+ltconfig, ltmain.sh).  Another support script, install-sh, is copyright
+by M.I.T. but is also freely distributable.
+
+It appears that the arithmetic coding option of the JPEG spec is covered by
+patents owned by IBM, AT&T, and Mitsubishi.  Hence arithmetic coding cannot
+legally be used without obtaining one or more licenses.  For this reason,
+support for arithmetic coding has been removed from the free JPEG software.
+(Since arithmetic coding provides only a marginal gain over the unpatented
+Huffman mode, it is unlikely that very many implementations will support it.)
+So far as we are aware, there are no patent restrictions on the remaining
+code.
+
+The IJG distribution formerly included code to read and write GIF files.
+To avoid entanglement with the Unisys LZW patent, GIF reading support has
+been removed altogether, and the GIF writer has been simplified to produce
+"uncompressed GIFs".  This technique does not use the LZW algorithm; the
+resulting GIF files are larger than usual, but are readable by all standard
+GIF decoders.
+
+We are required to state that
+    "The Graphics Interchange Format(c) is the Copyright property of
+    CompuServe Incorporated.  GIF(sm) is a Service Mark property of
+    CompuServe Incorporated."
+
+
+REFERENCES
+==========
+
+We highly recommend reading one or more of these references before trying to
+understand the innards of the JPEG software.
+
+The best short technical introduction to the JPEG compression algorithm is
+	Wallace, Gregory K.  "The JPEG Still Picture Compression Standard",
+	Communications of the ACM, April 1991 (vol. 34 no. 4), pp. 30-44.
+(Adjacent articles in that issue discuss MPEG motion picture compression,
+applications of JPEG, and related topics.)  If you don't have the CACM issue
+handy, a PostScript file containing a revised version of Wallace's article is
+available at ftp://ftp.uu.net/graphics/jpeg/wallace.ps.gz.  The file (actually
+a preprint for an article that appeared in IEEE Trans. Consumer Electronics)
+omits the sample images that appeared in CACM, but it includes corrections
+and some added material.  Note: the Wallace article is copyright ACM and IEEE,
+and it may not be used for commercial purposes.
+
+A somewhat less technical, more leisurely introduction to JPEG can be found in
+"The Data Compression Book" by Mark Nelson and Jean-loup Gailly, published by
+M&T Books (New York), 2nd ed. 1996, ISBN 1-55851-434-1.  This book provides
+good explanations and example C code for a multitude of compression methods
+including JPEG.  It is an excellent source if you are comfortable reading C
+code but don't know much about data compression in general.  The book's JPEG
+sample code is far from industrial-strength, but when you are ready to look
+at a full implementation, you've got one here...
+
+The best full description of JPEG is the textbook "JPEG Still Image Data
+Compression Standard" by William B. Pennebaker and Joan L. Mitchell, published
+by Van Nostrand Reinhold, 1993, ISBN 0-442-01272-1.  Price US$59.95, 638 pp.
+The book includes the complete text of the ISO JPEG standards (DIS 10918-1
+and draft DIS 10918-2).  This is by far the most complete exposition of JPEG
+in existence, and we highly recommend it.
+
+The JPEG standard itself is not available electronically; you must order a
+paper copy through ISO or ITU.  (Unless you feel a need to own a certified
+official copy, we recommend buying the Pennebaker and Mitchell book instead;
+it's much cheaper and includes a great deal of useful explanatory material.)
+In the USA, copies of the standard may be ordered from ANSI Sales at (212)
+642-4900, or from Global Engineering Documents at (800) 854-7179.  (ANSI
+doesn't take credit card orders, but Global does.)  It's not cheap: as of
+1992, ANSI was charging $95 for Part 1 and $47 for Part 2, plus 7%
+shipping/handling.  The standard is divided into two parts, Part 1 being the
+actual specification, while Part 2 covers compliance testing methods.  Part 1
+is titled "Digital Compression and Coding of Continuous-tone Still Images,
+Part 1: Requirements and guidelines" and has document numbers ISO/IEC IS
+10918-1, ITU-T T.81.  Part 2 is titled "Digital Compression and Coding of
+Continuous-tone Still Images, Part 2: Compliance testing" and has document
+numbers ISO/IEC IS 10918-2, ITU-T T.83.
+
+Some extensions to the original JPEG standard are defined in JPEG Part 3,
+a newer ISO standard numbered ISO/IEC IS 10918-3 and ITU-T T.84.  IJG
+currently does not support any Part 3 extensions.
+
+The JPEG standard does not specify all details of an interchangeable file
+format.  For the omitted details we follow the "JFIF" conventions, revision
+1.02.  A copy of the JFIF spec is available from:
+	Literature Department
+	C-Cube Microsystems, Inc.
+	1778 McCarthy Blvd.
+	Milpitas, CA 95035
+	phone (408) 944-6300,  fax (408) 944-6314
+A PostScript version of this document is available by FTP at
+ftp://ftp.uu.net/graphics/jpeg/jfif.ps.gz.  There is also a plain text
+version at ftp://ftp.uu.net/graphics/jpeg/jfif.txt.gz, but it is missing
+the figures.
+
+The TIFF 6.0 file format specification can be obtained by FTP from
+ftp://ftp.sgi.com/graphics/tiff/TIFF6.ps.gz.  The JPEG incorporation scheme
+found in the TIFF 6.0 spec of 3-June-92 has a number of serious problems.
+IJG does not recommend use of the TIFF 6.0 design (TIFF Compression tag 6).
+Instead, we recommend the JPEG design proposed by TIFF Technical Note #2
+(Compression tag 7).  Copies of this Note can be obtained from ftp.sgi.com or
+from ftp://ftp.uu.net/graphics/jpeg/.  It is expected that the next revision
+of the TIFF spec will replace the 6.0 JPEG design with the Note's design.
+Although IJG's own code does not support TIFF/JPEG, the free libtiff library
+uses our library to implement TIFF/JPEG per the Note.  libtiff is available
+from ftp://ftp.sgi.com/graphics/tiff/.
+
+
+ARCHIVE LOCATIONS
+=================
+
+The "official" archive site for this software is ftp.uu.net (Internet
+address 192.48.96.9).  The most recent released version can always be found
+there in directory graphics/jpeg.  This particular version will be archived
+as ftp://ftp.uu.net/graphics/jpeg/jpegsrc.v6b.tar.gz.  If you don't have
+direct Internet access, UUNET's archives are also available via UUCP; contact
[email protected] for information on retrieving files that way.
+
+Numerous Internet sites maintain copies of the UUNET files.  However, only
+ftp.uu.net is guaranteed to have the latest official version.
+
+You can also obtain this software in DOS-compatible "zip" archive format from
+the SimTel archives (ftp://ftp.simtel.net/pub/simtelnet/msdos/graphics/), or
+on CompuServe in the Graphics Support forum (GO CIS:GRAPHSUP), library 12
+"JPEG Tools".  Again, these versions may sometimes lag behind the ftp.uu.net
+release.
+
+The JPEG FAQ (Frequently Asked Questions) article is a useful source of
+general information about JPEG.  It is updated constantly and therefore is
+not included in this distribution.  The FAQ is posted every two weeks to
+Usenet newsgroups comp.graphics.misc, news.answers, and other groups.
+It is available on the World Wide Web at http://www.faqs.org/faqs/jpeg-faq/
+and other news.answers archive sites, including the official news.answers
+archive at rtfm.mit.edu: ftp://rtfm.mit.edu/pub/usenet/news.answers/jpeg-faq/.
+If you don't have Web or FTP access, send e-mail to [email protected]
+with body
+	send usenet/news.answers/jpeg-faq/part1
+	send usenet/news.answers/jpeg-faq/part2
+
+
+RELATED SOFTWARE
+================
+
+Numerous viewing and image manipulation programs now support JPEG.  (Quite a
+few of them use this library to do so.)  The JPEG FAQ described above lists
+some of the more popular free and shareware viewers, and tells where to
+obtain them on Internet.
+
+If you are on a Unix machine, we highly recommend Jef Poskanzer's free
+PBMPLUS software, which provides many useful operations on PPM-format image
+files.  In particular, it can convert PPM images to and from a wide range of
+other formats, thus making cjpeg/djpeg considerably more useful.  The latest
+version is distributed by the NetPBM group, and is available from numerous
+sites, notably ftp://wuarchive.wustl.edu/graphics/graphics/packages/NetPBM/.
+Unfortunately PBMPLUS/NETPBM is not nearly as portable as the IJG software is;
+you are likely to have difficulty making it work on any non-Unix machine.
+
+A different free JPEG implementation, written by the PVRG group at Stanford,
+is available from ftp://havefun.stanford.edu/pub/jpeg/.  This program
+is designed for research and experimentation rather than production use;
+it is slower, harder to use, and less portable than the IJG code, but it
+is easier to read and modify.  Also, the PVRG code supports lossless JPEG,
+which we do not.  (On the other hand, it doesn't do progressive JPEG.)
+
+
+FILE FORMAT WARS
+================
+
+Some JPEG programs produce files that are not compatible with our library.
+The root of the problem is that the ISO JPEG committee failed to specify a
+concrete file format.  Some vendors "filled in the blanks" on their own,
+creating proprietary formats that no one else could read.  (For example, none
+of the early commercial JPEG implementations for the Macintosh were able to
+exchange compressed files.)
+
+The file format we have adopted is called JFIF (see REFERENCES).  This format
+has been agreed to by a number of major commercial JPEG vendors, and it has
+become the de facto standard.  JFIF is a minimal or "low end" representation.
+We recommend the use of TIFF/JPEG (TIFF revision 6.0 as modified by TIFF
+Technical Note #2) for "high end" applications that need to record a lot of
+additional data about an image.  TIFF/JPEG is fairly new and not yet widely
+supported, unfortunately.
+
+The upcoming JPEG Part 3 standard defines a file format called SPIFF.
+SPIFF is interoperable with JFIF, in the sense that most JFIF decoders should
+be able to read the most common variant of SPIFF.  SPIFF has some technical
+advantages over JFIF, but its major claim to fame is simply that it is an
+official standard rather than an informal one.  At this point it is unclear
+whether SPIFF will supersede JFIF or whether JFIF will remain the de-facto
+standard.  IJG intends to support SPIFF once the standard is frozen, but we
+have not decided whether it should become our default output format or not.
+(In any case, our decoder will remain capable of reading JFIF indefinitely.)
+
+Various proprietary file formats incorporating JPEG compression also exist.
+We have little or no sympathy for the existence of these formats.  Indeed,
+one of the original reasons for developing this free software was to help
+force convergence on common, open format standards for JPEG files.  Don't
+use a proprietary file format!
+
+
+TO DO
+=====
+
+The major thrust for v7 will probably be improvement of visual quality.
+The current method for scaling the quantization tables is known not to be
+very good at low Q values.  We also intend to investigate block boundary
+smoothing, "poor man's variable quantization", and other means of improving
+quality-vs-file-size performance without sacrificing compatibility.
+
+In future versions, we are considering supporting some of the upcoming JPEG
+Part 3 extensions --- principally, variable quantization and the SPIFF file
+format.
+
+As always, speeding things up is of great interest.
+
+Please send bug reports, offers of help, etc. to [email protected].
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/desktop/libjpeg/libjpeg.p5m	Thu Mar 17 08:44:16 2016 -0700
@@ -0,0 +1,59 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+#
+
+<transform file path=usr.*/man/.+ -> default mangler.man.stability uncommitted>
+set name=pkg.fmri \
+    value=pkg:/image/library/libjpeg@$(IPS_COMPONENT_VERSION),$(BUILD_VERSION)
+set name=pkg.summary value="jpeg - The Independent JPEG Groups JPEG software"
+set name=com.oracle.info.description value=libjpeg
+set name=com.oracle.info.tpno value=$(TPNO)
+set name=info.classification \
+    value="org.opensolaris.category.2008:System/Multimedia Libraries"
+set name=info.source-url value=$(COMPONENT_ARCHIVE_URL)
+set name=info.upstream-url value=$(COMPONENT_PROJECT_URL)
+set name=org.opensolaris.arc-caseid value=LSARC/2003/085
+set name=org.opensolaris.consolidation value=$(CONSOLIDATION)
+file $(MACH64)/cjpeg path=usr/bin/cjpeg
+file $(MACH64)/djpeg path=usr/bin/djpeg
+file $(MACH64)/jpegtran path=usr/bin/jpegtran
+file $(MACH64)/rdjpgcom path=usr/bin/rdjpgcom
+file $(MACH64)/wrjpgcom path=usr/bin/wrjpgcom
+file path=usr/include/jconfig.h
+file path=usr/include/jerror.h
+file path=usr/include/jmorecfg.h
+file path=usr/include/jpeglib.h
+link path=usr/lib/$(MACH64)/libjpeg.so target=libjpeg.so.62.0.0
+link path=usr/lib/$(MACH64)/libjpeg.so.62 target=libjpeg.so.62.0.0
+file $(MACH64)/.libs/libjpeg.so.62.0.0 path=usr/lib/$(MACH64)/libjpeg.so.62.0.0
+link path=usr/lib/libjpeg.so target=libjpeg.so.62.0.0
+link path=usr/lib/libjpeg.so.62 target=libjpeg.so.62.0.0
+file $(MACH32)/.libs/libjpeg.so.62.0.0 path=usr/lib/libjpeg.so.62.0.0
+file path=usr/share/man/man1/cjpeg.1
+file path=usr/share/man/man1/djpeg.1
+file path=usr/share/man/man1/jpegtran.1
+file path=usr/share/man/man1/rdjpgcom.1
+file path=usr/share/man/man1/wrjpgcom.1
+file files/libjpeg.3 path=usr/share/man/man3/libjpeg.3
+license libjpeg.license license="libjpeg, GPL"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/desktop/libjpeg/patches/libjpg-01-makefile.cfg.patch	Thu Mar 17 08:44:16 2016 -0700
@@ -0,0 +1,22 @@
+Internal patch, not suitable for upstream
+
+--- jpeg-6b/makefile.cfg.orig	2015-07-14 09:52:32.223048157 -0700
++++ jpeg-6b/makefile.cfg	2015-07-14 09:53:18.063812769 -0700
+@@ -17,7 +17,7 @@
+ binprefix =
+ manprefix =
+ manext = 1
+-mandir = $(prefix)/man/man$(manext)
++mandir = $(prefix)/share/man/man$(manext)
+ 
+ # The name of your C compiler:
+ CC= @CC@
+@@ -168,7 +168,7 @@
+ 
+ # with libtool:
+ libjpeg.la: @A2K_DEPS@ $(LIBOBJECTS)
+-	$(LIBTOOL) --mode=link $(CC) -o libjpeg.la $(LIBOBJECTS) \
++	$(LIBTOOL) --mode=link $(CC) $(LDFLAGS) -o libjpeg.la $(LIBOBJECTS) \
+ 		-rpath $(libdir) -version-info $(JPEG_LIB_VERSION)
+ 
+ # sample programs:
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/desktop/libjpeg/test/results-all.master	Thu Mar 17 08:44:16 2016 -0700
@@ -0,0 +1,15 @@
+make[1]: Entering directory '$(@D)'
+rm -f testout*
+./djpeg -dct int -ppm -outfile testout.ppm  $(SOURCE_DIR)/testorig.jpg
+./djpeg -dct int -bmp -colors 256 -outfile testout.bmp  $(SOURCE_DIR)/testorig.jpg
+./cjpeg -dct int -outfile testout.jpg  $(SOURCE_DIR)/testimg.ppm
+./djpeg -dct int -ppm -outfile testoutp.ppm $(SOURCE_DIR)/testprog.jpg
+./cjpeg -dct int -progressive -opt -outfile testoutp.jpg $(SOURCE_DIR)/testimg.ppm
+./jpegtran -outfile testoutt.jpg $(SOURCE_DIR)/testprog.jpg
+cmp $(SOURCE_DIR)/testimg.ppm testout.ppm
+cmp $(SOURCE_DIR)/testimg.bmp testout.bmp
+cmp $(SOURCE_DIR)/testimg.jpg testout.jpg
+cmp $(SOURCE_DIR)/testimg.ppm testoutp.ppm
+cmp $(SOURCE_DIR)/testimgp.jpg testoutp.jpg
+cmp $(SOURCE_DIR)/testorig.jpg testoutt.jpg
+make[1]: Leaving directory '$(@D)'
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/desktop/libpng/Makefile	Thu Mar 17 08:44:16 2016 -0700
@@ -0,0 +1,162 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+#
+
+COMPILER =		gcc
+
+include ../../../make-rules/shared-macros.mk
+
+COMPONENT_NAME=		libpng
+COMPONENT_VERSION=	1.4.11
+COMPONENT_PROJECT_URL=	http://www.libpng.org/
+COMPONENT_SRC=		$(COMPONENT_NAME)-$(COMPONENT_VERSION)
+COMPONENT_ARCHIVE=	$(COMPONENT_SRC).tar.gz
+COMPONENT_ARCHIVE_HASH=	\
+	sha256:28f5254d7cb28fe090d04b45619670fa05c7ad3d44da1c60eee59ce39a315537
+COMPONENT_ARCHIVE_URL=	https://sourceforge.net/projects/libpng/files/libpng14/older-releases/1.4.11/$(COMPONENT_ARCHIVE)
+COMPONENT_BUGDB=	library/libpng
+
+COMPONENT_VERSION_1 =   1.2.49
+COMPONENT_SRC_1 =       $(COMPONENT_NAME)-$(COMPONENT_VERSION_1)
+COMPONENT_ARCHIVE_1 =   $(COMPONENT_SRC_1).tar.gz
+COMPONENT_ARCHIVE_HASH_1 = \
+    sha256:f906778030f5dc7930844b9d67ddf4f2809f7407784c4eba7e8d6e0db9f61671
+COMPONENT_ARCHIVE_URL_1= https://sourceforge.net/projects/libpng/files/libpng12/older-releases/1.2.49/$(COMPONENT_ARCHIVE_1)
+SOURCE_DIR_1 =          $(COMPONENT_DIR)/$(COMPONENT_SRC_1)
+
+
+COMPONENT_VERSION_2 =   1.0.59
+COMPONENT_SRC_2 =       $(COMPONENT_NAME)-$(COMPONENT_VERSION_2)
+COMPONENT_ARCHIVE_2 =   $(COMPONENT_SRC_2).tar.gz
+COMPONENT_ARCHIVE_HASH_2 = \
+    sha256:33e0d3ac3b7c48450acd298e198d243e0d5400e2436d6eec67f2a283cd82e7c4
+COMPONENT_ARCHIVE_URL_2= https://sourceforge.net/projects/libpng/files/libpng10/older-releases/1.0.59/$(COMPONENT_ARCHIVE_2)
+SOURCE_DIR_2 =          $(COMPONENT_DIR)/$(COMPONENT_SRC_2)
+
+TPNO=		11954
+
+include $(WS_MAKE_RULES)/prep.mk
+include $(WS_MAKE_RULES)/configure.mk
+include $(WS_MAKE_RULES)/ips.mk
+
+LDFLAGS +=	$(CC_BITS)
+
+CONFIGURE_OPTIONS +=	--with-esd-prefix=$(PROTOUSRDIR)
+CONFIGURE_OPTIONS +=	LDFLAGS=$(LDFLAGS)
+
+# ------------------------ libpng10 ----------------------------
+
+# Macros to configure, build, and install the libpng10 files.
+BUILD_PNG10_DIR_32 = $(COMPONENT_DIR)/build/$(COMPONENT_VERSION_2)-$(MACH32)
+BUILD_PNG10_DIR_64 = $(COMPONENT_DIR)/build/$(COMPONENT_VERSION_2)-$(MACH64)
+
+$(BUILD_PNG10_DIR_32)/.configured: CONFIGURE_SCRIPT = $(SOURCE_DIR_2)/configure
+$(BUILD_PNG10_DIR_64)/.configured: CONFIGURE_SCRIPT = $(SOURCE_DIR_2)/configure
+$(BUILD_PNG10_DIR_32)/.configured: BITS=32
+$(BUILD_PNG10_DIR_64)/.configured: BITS=64
+
+BUILD_32 += $(BUILD_PNG10_DIR_32)/.built
+BUILD_64 += $(BUILD_PNG10_DIR_64)/.built
+
+INSTALL_32 += $(BUILD_PNG10_DIR_32)/.installed
+INSTALL_64 += $(BUILD_PNG10_DIR_64)/.installed
+
+$(BUILD_DIR_32)/.installed:     $(BUILD_PNG10_DIR_32)/.installed
+$(BUILD_DIR_64)/.installed:     $(BUILD_PNG10_DIR_64)/.installed
+
+# we need to prep this version too (this should be handled in prep.mk)
+$(SOURCE_DIR_2)/.unpacked:        download $(MAKEFILE_PREREQ) $(PATCHES)
+	$(RM) -r $(SOURCE_DIR_2)
+	$(UNPACK) $(UNPACK_ARGS) $(COMPONENT_ARCHIVE_2)
+	$(TOUCH) $@
+
+$(SOURCE_DIR_2)/.prep:        $(SOURCE_DIR_2)/.unpacked
+	$(TOUCH) $@
+
+# ------------------------ libpng12 ----------------------------
+
+# Macros to configure, build, and install the libpng12 files.
+BUILD_PNG12_DIR_32 = $(COMPONENT_DIR)/build/$(COMPONENT_VERSION_1)-$(MACH32)
+BUILD_PNG12_DIR_64 = $(COMPONENT_DIR)/build/$(COMPONENT_VERSION_1)-$(MACH64)
+
+$(BUILD_PNG12_DIR_32)/.configured: CONFIGURE_SCRIPT = $(SOURCE_DIR_1)/configure
+$(BUILD_PNG12_DIR_64)/.configured: CONFIGURE_SCRIPT = $(SOURCE_DIR_1)/configure
+$(BUILD_PNG12_DIR_32)/.configured: BITS=32
+$(BUILD_PNG12_DIR_64)/.configured: BITS=64
+
+BUILD_32 += $(BUILD_PNG12_DIR_32)/.built
+BUILD_64 += $(BUILD_PNG12_DIR_64)/.built
+
+INSTALL_32 += $(BUILD_PNG12_DIR_32)/.installed
+INSTALL_64 += $(BUILD_PNG12_DIR_64)/.installed
+
+$(BUILD_DIR_32)/.installed:     $(BUILD_PNG12_DIR_32)/.installed
+$(BUILD_DIR_64)/.installed:     $(BUILD_PNG12_DIR_64)/.installed
+
+# we need to prep this version too (this should be handled in prep.mk)
+$(SOURCE_DIR_1)/.unpacked:        download $(MAKEFILE_PREREQ) $(PATCHES)
+	$(RM) -r $(SOURCE_DIR_1)
+	$(UNPACK) $(UNPACK_ARGS) $(COMPONENT_ARCHIVE_1)
+	$(TOUCH) $@
+
+# prep the two older versions first
+$(SOURCE_DIR)/.prep:    $(SOURCE_DIR_1)/.prep $(SOURCE_DIR_2)/.prep
+
+$(SOURCE_DIR_1)/.prep:        $(SOURCE_DIR_1)/.unpacked
+	$(TOUCH) $@
+
+# -----------------------------------------------------------------
+
+prep::		$(SOURCE_DIR_1)/.prep $(SOURCE_DIR_2)/.prep
+
+CLEAN_PATHS +=	$(SOURCE_DIR_1)
+CLEAN_PATHS +=	$(SOURCE_DIR_2)
+
+COMPONENT_TEST_MASTER = $(COMPONENT_TEST_RESULTS_DIR)/results-all.master
+COMPONENT_TEST_ARGS = -k -i
+COMPONENT_TEST_TRANSFORMS += \
+        '-n ' \
+        '-e "/Pass /p" ' \
+        '-e "/TOTAL:/p" ' \
+        '-e "/Filter/p" ' \
+        '-e "/PASS/p" ' \
+        '-e "/ERROR:/p" '
+
+
+ASLR_MODE =	$(ASLR_ENABLE)
+
+configure:	$(CONFIGURE_32_and_64)
+
+build:          $(BUILD_32_and_64)
+
+install:        $(INSTALL_32_and_64)
+
+test:           $(TEST_32_and_64)
+
+system-test:    $(SYSTEM_TESTS_NOT_IMPLEMENTED)
+
+REQUIRED_PACKAGES += library/zlib
+REQUIRED_PACKAGES += shell/ksh93
+REQUIRED_PACKAGES += system/library
+REQUIRED_PACKAGES += system/library/math
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/desktop/libpng/files/png.4	Thu Mar 17 08:44:16 2016 -0700
@@ -0,0 +1,32 @@
+'\" te
+.TH png\&.4 4 "26 Mar 2004" "SunOS 5.11" "File Formats"
+.SH "NAME"
+png \- Portable Network
+Graphics (PNG) format
+.SH "DESCRIPTION"
+.PP
+PNG (Portable Network Graphics) is an extensible file format for the
+lossless, portable, well-compressed storage of raster images\&. PNG provides
+a patent-free replacement for GIF and can also replace many common uses of
+TIFF\&. Indexed-color, grayscale, and truecolor images are supported, and an
+optional alpha channel\&. Sample depths range from 1 to 16 bits\&.
+.PP
+PNG is designed to work well in online viewing applications, such as
+the World Wide Web, and is fully streamable with a progressive display option\&.
+PNG is robust, and provides both full file integrity checking, and fast simple
+detection of common transmission errors\&. PNG can store gamma and chromaticity
+data for improved color matching on heterogeneous platforms\&.
+.SH "SEE ALSO"
+.PP
+\fBlibpng\fR(3), \fBzlib\fR(3)
+.PP
+PNG 1\&.2 specification, July 1999: \fBhttp://www\&.libpng\&.org/pub/png\fR
+or \fBftp://ftp\&.uu\&.net/graphics/png/documents\fR
+.PP
+PNG 1\&.0 specification, October 1996: RFC 2083
+\fBftp://ds\&.internic\&.net/rfc/rfc2083\&.txt\fR
+or as a W3C Recommendation at
+\fBhttp://www\&.w3\&.org/TR/REC-png\&.html\fR
+.SH "NOTES"
+.PP
+This man page was originally written by Glenn Randers-Pehrson\&. Updated by Breda McColgan, Sun Microsystems Inc\&., 2004\&.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/desktop/libpng/libpng.license	Thu Mar 17 08:44:16 2016 -0700
@@ -0,0 +1,401 @@
+This copy of the libpng notices is provided for your convenience.  In case of
+any discrepancy between this copy and the notices in the file png.h that is
+included in the libpng distribution, the latter shall prevail.
+
+COPYRIGHT NOTICE, DISCLAIMER, and LICENSE:
+
+If you modify libpng you may insert additional notices immediately following
+this sentence.
+
+This code is released under the libpng license.
+
+libpng versions 1.2.6, August 15, 2004, through 1.4.3, June 26, 2010, are
+Copyright (c) 2004, 2006-2007 Glenn Randers-Pehrson, and are
+distributed according to the same disclaimer and license as libpng-1.2.5
+with the following individual added to the list of Contributing Authors
+
+   Cosmin Truta
+
+libpng versions 1.0.7, July 1, 2000, through 1.2.5 - October 3, 2002, are
+Copyright (c) 2000-2002 Glenn Randers-Pehrson, and are
+distributed according to the same disclaimer and license as libpng-1.0.6
+with the following individuals added to the list of Contributing Authors
+
+   Simon-Pierre Cadieux
+   Eric S. Raymond
+   Gilles Vollant
+
+and with the following additions to the disclaimer:
+
+   There is no warranty against interference with your enjoyment of the
+   library or against infringement.  There is no warranty that our
+   efforts or the library will fulfill any of your particular purposes
+   or needs.  This library is provided with all faults, and the entire
+   risk of satisfactory quality, performance, accuracy, and effort is with
+   the user.
+
+libpng versions 0.97, January 1998, through 1.0.6, March 20, 2000, are
+Copyright (c) 1998, 1999 Glenn Randers-Pehrson, and are
+distributed according to the same disclaimer and license as libpng-0.96,
+with the following individuals added to the list of Contributing Authors:
+
+   Tom Lane
+   Glenn Randers-Pehrson
+   Willem van Schaik
+
+libpng versions 0.89, June 1996, through 0.96, May 1997, are
+Copyright (c) 1996, 1997 Andreas Dilger
+Distributed according to the same disclaimer and license as libpng-0.88,
+with the following individuals added to the list of Contributing Authors:
+
+   John Bowler
+   Kevin Bracey
+   Sam Bushell
+   Magnus Holmgren
+   Greg Roelofs
+   Tom Tanner
+
+libpng versions 0.5, May 1995, through 0.88, January 1996, are
+Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
+
+For the purposes of this copyright and license, "Contributing Authors"
+is defined as the following set of individuals:
+
+   Andreas Dilger
+   Dave Martindale
+   Guy Eric Schalnat
+   Paul Schmidt
+   Tim Wegner
+
+The PNG Reference Library is supplied "AS IS".  The Contributing Authors
+and Group 42, Inc. disclaim all warranties, expressed or implied,
+including, without limitation, the warranties of merchantability and of
+fitness for any purpose.  The Contributing Authors and Group 42, Inc.
+assume no liability for direct, indirect, incidental, special, exemplary,
+or consequential damages, which may result from the use of the PNG
+Reference Library, even if advised of the possibility of such damage.
+
+Permission is hereby granted to use, copy, modify, and distribute this
+source code, or portions hereof, for any purpose, without fee, subject
+to the following restrictions:
+
+1. The origin of this source code must not be misrepresented.
+
+2. Altered versions must be plainly marked as such and must not
+   be misrepresented as being the original source.
+
+3. This Copyright notice may not be removed or altered from any
+   source or altered source distribution.
+
+The Contributing Authors and Group 42, Inc. specifically permit, without
+fee, and encourage the use of this source code as a component to
+supporting the PNG file format in commercial products.  If you use this
+source code in a product, acknowledgment is not required but would be
+appreciated.
+
+
+A "png_get_copyright" function is available, for convenient use in "about"
+boxes and the like:
+
+   printf("%s",png_get_copyright(NULL));
+
+Also, the PNG logo (in PNG format, of course) is supplied in the
+files "pngbar.png" and "pngbar.jpg (88x31) and "pngnow.png" (98x31).
+
+Libpng is OSI Certified Open Source Software.  OSI Certified Open Source is a
+certification mark of the Open Source Initiative.
+
+Glenn Randers-Pehrson
+glennrp at users.sourceforge.net
+June 26, 2010
+
+
+relevant part of png.h:
+
+
+/* png.h - header file for PNG reference library
+ *
+ * libpng version 1.4.3 - June 26, 2010
+ * Copyright (c) 1998-2010 Glenn Randers-Pehrson
+ * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
+ * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
+ *
+ * This code is released under the libpng license (See LICENSE, below)
+ *
+ * Authors and maintainers:
+ *  libpng versions 0.71, May 1995, through 0.88, January 1996: Guy Schalnat
+ *  libpng versions 0.89c, June 1996, through 0.96, May 1997: Andreas Dilger
+ *  libpng versions 0.97, January 1998, through 1.4.3 - June 26, 2010: Glenn
+ *  See also "Contributing Authors", below.
+ *
+ * Note about libpng version numbers:
+ *
+ *    Due to various miscommunications, unforeseen code incompatibilities
+ *    and occasional factors outside the authors' control, version numbering
+ *    on the library has not always been consistent and straightforward.
+ *    The following table summarizes matters since version 0.89c, which was
+ *    the first widely used release:
+ *
+ *    source                 png.h  png.h  shared-lib
+ *    version                string   int  version
+ *    -------                ------ -----  ----------
+ *    0.89c "1.0 beta 3"     0.89      89  1.0.89
+ *    0.90  "1.0 beta 4"     0.90      90  0.90  [should have been 2.0.90]
+ *    0.95  "1.0 beta 5"     0.95      95  0.95  [should have been 2.0.95]
+ *    0.96  "1.0 beta 6"     0.96      96  0.96  [should have been 2.0.96]
+ *    0.97b "1.00.97 beta 7" 1.00.97   97  1.0.1 [should have been 2.0.97]
+ *    0.97c                  0.97      97  2.0.97
+ *    0.98                   0.98      98  2.0.98
+ *    0.99                   0.99      98  2.0.99
+ *    0.99a-m                0.99      99  2.0.99
+ *    1.00                   1.00     100  2.1.0 [100 should be 10000]
+ *    1.0.0      (from here on, the   100  2.1.0 [100 should be 10000]
+ *    1.0.1       png.h string is   10001  2.1.0
+ *    1.0.1a-e    identical to the  10002  from here on, the shared library
+ *    1.0.2       source version)   10002  is 2.V where V is the source code
+ *    1.0.2a-b                      10003  version, except as noted.
+ *    1.0.3                         10003
+ *    1.0.3a-d                      10004
+ *    1.0.4                         10004
+ *    1.0.4a-f                      10005
+ *    1.0.5 (+ 2 patches)           10005
+ *    1.0.5a-d                      10006
+ *    1.0.5e-r                      10100 (not source compatible)
+ *    1.0.5s-v                      10006 (not binary compatible)
+ *    1.0.6 (+ 3 patches)           10006 (still binary incompatible)
+ *    1.0.6d-f                      10007 (still binary incompatible)
+ *    1.0.6g                        10007
+ *    1.0.6h                        10007  10.6h (testing xy.z so-numbering)
+ *    1.0.6i                        10007  10.6i
+ *    1.0.6j                        10007  2.1.0.6j (incompatible with 1.0.0)
+ *    1.0.7beta11-14        DLLNUM  10007  2.1.0.7beta11-14 (binary compatible)
+ *    1.0.7beta15-18           1    10007  2.1.0.7beta15-18 (binary compatible)
+ *    1.0.7rc1-2               1    10007  2.1.0.7rc1-2 (binary compatible)
+ *    1.0.7                    1    10007  (still compatible)
+ *    1.0.8beta1-4             1    10008  2.1.0.8beta1-4
+ *    1.0.8rc1                 1    10008  2.1.0.8rc1
+ *    1.0.8                    1    10008  2.1.0.8
+ *    1.0.9beta1-6             1    10009  2.1.0.9beta1-6
+ *    1.0.9rc1                 1    10009  2.1.0.9rc1
+ *    1.0.9beta7-10            1    10009  2.1.0.9beta7-10
+ *    1.0.9rc2                 1    10009  2.1.0.9rc2
+ *    1.0.9                    1    10009  2.1.0.9
+ *    1.0.10beta1              1    10010  2.1.0.10beta1
+ *    1.0.10rc1                1    10010  2.1.0.10rc1
+ *    1.0.10                   1    10010  2.1.0.10
+ *    1.0.11beta1-3            1    10011  2.1.0.11beta1-3
+ *    1.0.11rc1                1    10011  2.1.0.11rc1
+ *    1.0.11                   1    10011  2.1.0.11
+ *    1.0.12beta1-2            2    10012  2.1.0.12beta1-2
+ *    1.0.12rc1                2    10012  2.1.0.12rc1
+ *    1.0.12                   2    10012  2.1.0.12
+ *    1.1.0a-f                 -    10100  2.1.1.0a-f (branch abandoned)
+ *    1.2.0beta1-2             2    10200  2.1.2.0beta1-2
+ *    1.2.0beta3-5             3    10200  3.1.2.0beta3-5
+ *    1.2.0rc1                 3    10200  3.1.2.0rc1
+ *    1.2.0                    3    10200  3.1.2.0
+ *    1.2.1beta1-4             3    10201  3.1.2.1beta1-4
+ *    1.2.1rc1-2               3    10201  3.1.2.1rc1-2
+ *    1.2.1                    3    10201  3.1.2.1
+ *    1.2.2beta1-6            12    10202  12.so.0.1.2.2beta1-6
+ *    1.0.13beta1             10    10013  10.so.0.1.0.13beta1
+ *    1.0.13rc1               10    10013  10.so.0.1.0.13rc1
+ *    1.2.2rc1                12    10202  12.so.0.1.2.2rc1
+ *    1.0.13                  10    10013  10.so.0.1.0.13
+ *    1.2.2                   12    10202  12.so.0.1.2.2
+ *    1.2.3rc1-6              12    10203  12.so.0.1.2.3rc1-6
+ *    1.2.3                   12    10203  12.so.0.1.2.3
+ *    1.2.4beta1-3            13    10204  12.so.0.1.2.4beta1-3
+ *    1.0.14rc1               13    10014  10.so.0.1.0.14rc1
+ *    1.2.4rc1                13    10204  12.so.0.1.2.4rc1
+ *    1.0.14                  10    10014  10.so.0.1.0.14
+ *    1.2.4                   13    10204  12.so.0.1.2.4
+ *    1.2.5beta1-2            13    10205  12.so.0.1.2.5beta1-2
+ *    1.0.15rc1-3             10    10015  10.so.0.1.0.15rc1-3
+ *    1.2.5rc1-3              13    10205  12.so.0.1.2.5rc1-3
+ *    1.0.15                  10    10015  10.so.0.1.0.15
+ *    1.2.5                   13    10205  12.so.0.1.2.5
+ *    1.2.6beta1-4            13    10206  12.so.0.1.2.6beta1-4
+ *    1.0.16                  10    10016  10.so.0.1.0.16
+ *    1.2.6                   13    10206  12.so.0.1.2.6
+ *    1.2.7beta1-2            13    10207  12.so.0.1.2.7beta1-2
+ *    1.0.17rc1               10    10017  12.so.0.1.0.17rc1
+ *    1.2.7rc1                13    10207  12.so.0.1.2.7rc1
+ *    1.0.17                  10    10017  12.so.0.1.0.17
+ *    1.2.7                   13    10207  12.so.0.1.2.7
+ *    1.2.8beta1-5            13    10208  12.so.0.1.2.8beta1-5
+ *    1.0.18rc1-5             10    10018  12.so.0.1.0.18rc1-5
+ *    1.2.8rc1-5              13    10208  12.so.0.1.2.8rc1-5
+ *    1.0.18                  10    10018  12.so.0.1.0.18
+ *    1.2.8                   13    10208  12.so.0.1.2.8
+ *    1.2.9beta1-3            13    10209  12.so.0.1.2.9beta1-3
+ *    1.2.9beta4-11           13    10209  12.so.0.9[.0]
+ *    1.2.9rc1                13    10209  12.so.0.9[.0]
+ *    1.2.9                   13    10209  12.so.0.9[.0]
+ *    1.2.10beta1-7           13    10210  12.so.0.10[.0]
+ *    1.2.10rc1-2             13    10210  12.so.0.10[.0]
+ *    1.2.10                  13    10210  12.so.0.10[.0]
+ *    1.4.0beta1-5            14    10400  14.so.0.0[.0]
+ *    1.2.11beta1-4           13    10211  12.so.0.11[.0]
+ *    1.4.0beta7-8            14    10400  14.so.0.0[.0]
+ *    1.2.11                  13    10211  12.so.0.11[.0]
+ *    1.2.12                  13    10212  12.so.0.12[.0]
+ *    1.4.0beta9-14           14    10400  14.so.0.0[.0]
+ *    1.2.13                  13    10213  12.so.0.13[.0]
+ *    1.4.0beta15-36          14    10400  14.so.0.0[.0]
+ *    1.4.0beta37-87          14    10400  14.so.14.0[.0]
+ *    1.4.0rc01               14    10400  14.so.14.0[.0]
+ *    1.4.0beta88-109         14    10400  14.so.14.0[.0]
+ *    1.4.0rc02-08            14    10400  14.so.14.0[.0]
+ *    1.4.0                   14    10400  14.so.14.0[.0]
+ *    1.4.1beta01-03          14    10401  14.so.14.1[.0]
+ *    1.4.1rc01               14    10401  14.so.14.1[.0]
+ *    1.4.1beta04-12          14    10401  14.so.14.1[.0]
+ *    1.4.1rc02-04            14    10401  14.so.14.1[.0]
+ *    1.4.1                   14    10401  14.so.14.1[.0]
+ *    1.4.2beta01             14    10402  14.so.14.2[.0]
+ *    1.4.2rc02-06            14    10402  14.so.14.2[.0]
+ *    1.4.2                   14    10402  14.so.14.2[.0]
+ *    1.4.3beta01-05          14    10403  14.so.14.3[.0]
+ *    1.4.3rc01-03            14    10403  14.so.14.3[.0]
+ *    1.4.3                   14    10403  14.so.14.3[.0]
+ *
+ *    Henceforth the source version will match the shared-library major
+ *    and minor numbers; the shared-library major version number will be
+ *    used for changes in backward compatibility, as it is intended.  The
+ *    PNG_LIBPNG_VER macro, which is not used within libpng but is available
+ *    for applications, is an unsigned integer of the form xyyzz corresponding
+ *    to the source version x.y.z (leading zeros in y and z).  Beta versions
+ *    were given the previous public release number plus a letter, until
+ *    version 1.0.6j; from then on they were given the upcoming public
+ *    release number plus "betaNN" or "rcN".
+ *
+ *    Binary incompatibility exists only when applications make direct access
+ *    to the info_ptr or png_ptr members through png.h, and the compiled
+ *    application is loaded with a different version of the library.
+ *
+ *    DLLNUM will change each time there are forward or backward changes
+ *    in binary compatibility (e.g., when a new feature is added).
+ *
+ * See libpng.txt or libpng.3 for more information.  The PNG specification
+ * is available as a W3C Recommendation and as an ISO Specification,
+ * <http://www.w3.org/TR/2003/REC-PNG-20031110/
+ */
+
+/*
+ * COPYRIGHT NOTICE, DISCLAIMER, and LICENSE:
+ *
+ * If you modify libpng you may insert additional notices immediately following
+ * this sentence.
+ *
+ * This code is released under the libpng license.
+ *
+ * libpng versions 1.2.6, August 15, 2004, through 1.4.3, June 26, 2010, are
+ * Copyright (c) 2004, 2006-2010 Glenn Randers-Pehrson, and are
+ * distributed according to the same disclaimer and license as libpng-1.2.5
+ * with the following individual added to the list of Contributing Authors:
+ *
+ *    Cosmin Truta
+ *
+ * libpng versions 1.0.7, July 1, 2000, through 1.2.5, October 3, 2002, are
+ * Copyright (c) 2000-2002 Glenn Randers-Pehrson, and are
+ * distributed according to the same disclaimer and license as libpng-1.0.6
+ * with the following individuals added to the list of Contributing Authors:
+ *
+ *    Simon-Pierre Cadieux
+ *    Eric S. Raymond
+ *    Gilles Vollant
+ *
+ * and with the following additions to the disclaimer:
+ *
+ *    There is no warranty against interference with your enjoyment of the
+ *    library or against infringement.  There is no warranty that our
+ *    efforts or the library will fulfill any of your particular purposes
+ *    or needs.  This library is provided with all faults, and the entire
+ *    risk of satisfactory quality, performance, accuracy, and effort is with
+ *    the user.
+ *
+ * libpng versions 0.97, January 1998, through 1.0.6, March 20, 2000, are
+ * Copyright (c) 1998, 1999, 2000 Glenn Randers-Pehrson, and are
+ * distributed according to the same disclaimer and license as libpng-0.96,
+ * with the following individuals added to the list of Contributing Authors:
+ *
+ *    Tom Lane
+ *    Glenn Randers-Pehrson
+ *    Willem van Schaik
+ *
+ * libpng versions 0.89, June 1996, through 0.96, May 1997, are
+ * Copyright (c) 1996, 1997 Andreas Dilger
+ * Distributed according to the same disclaimer and license as libpng-0.88,
+ * with the following individuals added to the list of Contributing Authors:
+ *
+ *    John Bowler
+ *    Kevin Bracey
+ *    Sam Bushell
+ *    Magnus Holmgren
+ *    Greg Roelofs
+ *    Tom Tanner
+ *
+ * libpng versions 0.5, May 1995, through 0.88, January 1996, are
+ * Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
+ *
+ * For the purposes of this copyright and license, "Contributing Authors"
+ * is defined as the following set of individuals:
+ *
+ *    Andreas Dilger
+ *    Dave Martindale
+ *    Guy Eric Schalnat
+ *    Paul Schmidt
+ *    Tim Wegner
+ *
+ * The PNG Reference Library is supplied "AS IS".  The Contributing Authors
+ * and Group 42, Inc. disclaim all warranties, expressed or implied,
+ * including, without limitation, the warranties of merchantability and of
+ * fitness for any purpose.  The Contributing Authors and Group 42, Inc.
+ * assume no liability for direct, indirect, incidental, special, exemplary,
+ * or consequential damages, which may result from the use of the PNG
+ * Reference Library, even if advised of the possibility of such damage.
+ *
+ * Permission is hereby granted to use, copy, modify, and distribute this
+ * source code, or portions hereof, for any purpose, without fee, subject
+ * to the following restrictions:
+ *
+ * 1. The origin of this source code must not be misrepresented.
+ *
+ * 2. Altered versions must be plainly marked as such and
+ * must not be misrepresented as being the original source.
+ *
+ * 3. This Copyright notice may not be removed or altered from
+ *    any source or altered source distribution.
+ *
+ * The Contributing Authors and Group 42, Inc. specifically permit, without
+ * fee, and encourage the use of this source code as a component to
+ * supporting the PNG file format in commercial products.  If you use this
+ * source code in a product, acknowledgment is not required but would be
+ * appreciated.
+ */
+
+/*
+ * A "png_get_copyright" function is available, for convenient use in "about"
+ * boxes and the like:
+ *
+ *     printf("%s",png_get_copyright(NULL));
+ *
+ * Also, the PNG logo (in PNG format, of course) is supplied in the
+ * files "pngbar.png" and "pngbar.jpg (88x31) and "pngnow.png" (98x31).
+ */
+
+/*
+ * Libpng is OSI Certified Open Source Software.  OSI Certified is a
+ * certification mark of the Open Source Initiative.
+ */
+
+/*
+ * The contributing authors would like to thank all those who helped
+ * with testing, bug fixes, and patience.  This wouldn't have been
+ * possible without all of you.
+ *
+ * Thanks to Frank J. T. Wojcik for helping with the documentation.
+ */
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/desktop/libpng/libpng.p5m	Thu Mar 17 08:44:16 2016 -0700
@@ -0,0 +1,96 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+#
+
+<transform file path=usr.*/man/.+ -> default mangler.man.stability uncommitted>
+set name=pkg.fmri \
+    value=pkg:/image/library/libpng@$(IPS_COMPONENT_VERSION),$(BUILD_VERSION)
+set name=pkg.summary value="Portable Network Graphics library"
+set name=pkg.description \
+    value="libpng is a C library for working with PNG (Portable Network Graphics) format images."
+set name=com.oracle.info.description value=libpng
+set name=com.oracle.info.tpno value=$(TPNO)
+set name=info.classification \
+    value="org.opensolaris.category.2008:System/Multimedia Libraries"
+set name=info.source-url value=$(COMPONENT_ARCHIVE_URL)
+set name=info.upstream-url value=$(COMPONENT_PROJECT_URL)
+set name=org.opensolaris.arc-caseid value=PSARC/2013/313
+set name=org.opensolaris.consolidation value=$(CONSOLIDATION)
+link path=usr/bin/$(MACH64)/libpng-config target=libpng14-config
+file path=usr/bin/$(MACH64)/libpng10-config
+file path=usr/bin/$(MACH64)/libpng12-config
+file path=usr/bin/$(MACH64)/libpng14-config
+link path=usr/bin/libpng-config target=libpng14-config
+file path=usr/bin/libpng10-config
+file path=usr/bin/libpng12-config
+file path=usr/bin/libpng14-config
+link path=usr/include/libpng target=libpng14
+file path=usr/include/libpng10/png.h
+file path=usr/include/libpng10/pngconf.h
+file path=usr/include/libpng12/png.h
+file path=usr/include/libpng12/pngconf.h
+file path=usr/include/libpng14/png.h
+file path=usr/include/libpng14/pngconf.h
+link path=usr/include/png.h target=libpng14/png.h
+link path=usr/include/pngconf.h target=libpng14/pngconf.h
+link path=usr/lib/$(MACH64)/libpng.so target=libpng14.so
+link path=usr/lib/$(MACH64)/libpng.so.2 target=libpng.so.2.59.0
+file path=usr/lib/$(MACH64)/libpng.so.2.59.0
+link path=usr/lib/$(MACH64)/libpng.so.3 target=libpng.so.3.49.0
+file path=usr/lib/$(MACH64)/libpng.so.3.49.0
+link path=usr/lib/$(MACH64)/libpng10.so target=libpng10.so.0.59.0
+link path=usr/lib/$(MACH64)/libpng10.so.0 target=libpng10.so.0.59.0
+file path=usr/lib/$(MACH64)/libpng10.so.0.59.0
+link path=usr/lib/$(MACH64)/libpng12.so target=libpng12.so.0.49.0
+link path=usr/lib/$(MACH64)/libpng12.so.0 target=libpng12.so.0.49.0
+file path=usr/lib/$(MACH64)/libpng12.so.0.49.0
+link path=usr/lib/$(MACH64)/libpng14.so target=libpng14.so.14.11.0
+link path=usr/lib/$(MACH64)/libpng14.so.14 target=libpng14.so.14.11.0
+file path=usr/lib/$(MACH64)/libpng14.so.14.11.0
+link path=usr/lib/$(MACH64)/pkgconfig/libpng.pc target=libpng14.pc
+file path=usr/lib/$(MACH64)/pkgconfig/libpng10.pc
+file path=usr/lib/$(MACH64)/pkgconfig/libpng12.pc
+file path=usr/lib/$(MACH64)/pkgconfig/libpng14.pc
+link path=usr/lib/libpng.so target=libpng14.so
+link path=usr/lib/libpng.so.2 target=libpng.so.2.59.0
+file path=usr/lib/libpng.so.2.59.0
+link path=usr/lib/libpng.so.3 target=libpng.so.3.49.0
+file path=usr/lib/libpng.so.3.49.0
+link path=usr/lib/libpng10.so target=libpng10.so.0.59.0
+link path=usr/lib/libpng10.so.0 target=libpng10.so.0.59.0
+file path=usr/lib/libpng10.so.0.59.0
+link path=usr/lib/libpng12.so target=libpng12.so.0.49.0
+link path=usr/lib/libpng12.so.0 target=libpng12.so.0.49.0
+file path=usr/lib/libpng12.so.0.49.0
+link path=usr/lib/libpng14.so target=libpng14.so.14.11.0
+link path=usr/lib/libpng14.so.14 target=libpng14.so.14.11.0
+file path=usr/lib/libpng14.so.14.11.0
+link path=usr/lib/pkgconfig/libpng.pc target=libpng14.pc
+file path=usr/lib/pkgconfig/libpng10.pc
+file path=usr/lib/pkgconfig/libpng12.pc
+file path=usr/lib/pkgconfig/libpng14.pc
+file path=usr/share/man/man3/libpng.3
+file path=usr/share/man/man3/libpngpf.3
+file files/png.4 path=usr/share/man/man4/png.4
+license libpng.license license=libpng
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/desktop/libpng/patches/libpng10-libpng12-CVE-2014-9495-CVE-2015-0973.patch_2	Thu Mar 17 08:44:16 2016 -0700
@@ -0,0 +1,15 @@
+This patch will be removed when we EOL the two older versions of libpng
+
+--- libpng-1.0.59/pngset.c.orig	2015-05-21 19:18:14.033684319 +0530
++++ libpng-1.0.59/pngset.c	2015-05-21 19:20:23.208626616 +0530
+@@ -263,7 +263,10 @@ png_set_IHDR(png_structp png_ptr, png_in
+                  - 1        /* filter byte */
+                  - 7*8      /* rounding of width to multiple of 8 pixels */
+                  - 8)       /* extra max_pixel_depth pad */
++   {
+       info_ptr->rowbytes = (png_size_t)0;
++      png_error(png_ptr, "Image width is too large for this architecture");
++   }
+    else
+       info_ptr->rowbytes = PNG_ROWBYTES(info_ptr->pixel_depth, width);
+ }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/desktop/libpng/patches/libpng14-CVE-2014-9495-CVE-2015-0973.patch	Thu Mar 17 08:44:16 2016 -0700
@@ -0,0 +1,16 @@
+Possibly suitable to be sent upstream. Need to evaluate when we update to a 
+recent version of libpng
+
+--- libpng-1.4.11/pngset.c.orig	2015-05-21 19:25:18.970310839 +0530
++++ libpng-1.4.11/pngset.c	2015-05-21 19:26:32.712686347 +0530
+@@ -257,7 +257,10 @@ png_set_IHDR(png_structp png_ptr, png_in
+                  - 1        /* filter byte */
+                  - 7*8      /* rounding of width to multiple of 8 pixels */
+                  - 8)       /* extra max_pixel_depth pad */
++   {
+       info_ptr->rowbytes = 0;
++      png_error(png_ptr, "Image width is too large for this architecture");
++   }
+    else
+       info_ptr->rowbytes = PNG_ROWBYTES(info_ptr->pixel_depth, width);
+ }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/desktop/libpng/test/results-all.master	Thu Mar 17 08:44:16 2016 -0700
@@ -0,0 +1,14 @@
+ Pass 0: rwrwrwrwrwrwrwrwrw
+ Pass 1: rwrwrwrwrwrwrwrwrw
+ Pass 2: rwrwrwrwrwrwrwrw
+ Pass 3: rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw
+ Pass 4: rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw
+ Pass 5: rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw
+ Pass 6: rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw
+ PASS (9782 zero samples)
+ Filter 0 was used 21 times
+ Filter 1 was used 15 times
+ Filter 2 was used 52 times
+ Filter 3 was used 10 times
+ Filter 4 was used 33 times
+PASS: test-pngtest.sh
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/desktop/libtiff/Makefile	Thu Mar 17 08:44:16 2016 -0700
@@ -0,0 +1,83 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+# Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+#
+
+include ../../../make-rules/shared-macros.mk
+
+COMPONENT_NAME=		libtiff
+COMPONENT_VERSION=	4.0.3
+COMPONENT_PROJECT_URL=	http://www.remotesensing.org/libtiff/
+COMPONENT_SRC=		tiff-$(COMPONENT_VERSION)
+COMPONENT_ARCHIVE=	$(COMPONENT_SRC).tar.gz
+COMPONENT_ARCHIVE_HASH= \
+    sha256:338a4d1d2a43aedb37a9ebef5b00dd3d27ca0d60b7d84b838735f64638896a3e
+COMPONENT_ARCHIVE_URL=	http://download.osgeo.org/libtiff/$(COMPONENT_ARCHIVE)
+COMPONENT_BUGDB=	library/libtiff
+
+TPNO=			9299
+
+# Added to find the *.3tiff that go into /usr/share/man/man3tiff
+PKG_PROTO_DIRS += $(COMPONENT_SRC)/man
+
+include $(WS_MAKE_RULES)/prep.mk
+include $(WS_MAKE_RULES)/configure.mk
+include $(WS_MAKE_RULES)/ips.mk
+
+CC 			+= $(CC_BITS)
+
+# Only build C library, not C++ library
+CONFIGURE_OPTIONS       += --disable-cxx
+# Only build shared library, not static libraries
+CONFIGURE_OPTIONS       += --enable-shared --disable-static
+# Don't build tiffgt utility which drags in a pile of OpenGL dependencies
+CONFIGURE_OPTIONS       += ax_cv_check_gl_libgl="no"
+
+COMPONENT_TEST_MASTER = $(COMPONENT_TEST_RESULTS_DIR)/results-all.master
+COMPONENT_TEST_ARGS =   -k -i
+COMPONENT_TEST_TARGETS	= check
+COMPONENT_TEST_TRANSFORMS += \
+        '-n ' \
+        '-e "/result_count/d" ' \
+        '-e "/TOTAL:/p" ' \
+        '-e "/SKIP:/p" ' \
+        '-e "/PASS:/p" ' \
+        '-e "/FAIL:/p" ' \
+        '-e "/ERROR:/p" '
+
+ASLR_MODE = $(ASLR_ENABLE)
+
+configure:	$(CONFIGURE_32_and_64)
+
+build:          $(BUILD_32_and_64)
+
+install:        $(INSTALL_32_and_64)
+
+test:           $(TEST_32_and_64)
+
+system-test:    $(SYSTEM_TESTS_NOT_IMPLEMENTED)
+
+REQUIRED_PACKAGES += compress/xz
+REQUIRED_PACKAGES += image/library/libjpeg
+REQUIRED_PACKAGES += library/zlib
+REQUIRED_PACKAGES += system/library
+REQUIRED_PACKAGES += system/library/math
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/desktop/libtiff/libtiff.license	Thu Mar 17 08:44:16 2016 -0700
@@ -0,0 +1,204 @@
+Copyright (c) 1996 Mike Johnson
+Copyright (c) 1996 BancTec AB
+
+Permission to use, copy, modify, distribute, and sell this software
+for any purpose is hereby granted without fee, provided
+that (i) the above copyright notices and this permission notice appear in
+all copies of the software and related documentation, and (ii) the names of
+Mike Johnson and BancTec may not be used in any advertising or
+publicity relating to the software.
+
+THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, 
+EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY 
+WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  
+
+IN NO EVENT SHALL MIKE JOHNSON OR BANCTEC BE LIABLE FOR
+ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
+OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF 
+LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE 
+OF THIS SOFTWARE.
+
+--------------------------------------------------------------------
+
+ Copyright (c) 1996-1997 Sam Leffler
+ Copyright (c) 1996 Pixar
+
+ Permission to use, copy, modify, distribute, and sell this software and 
+ its documentation for any purpose is hereby granted without fee, provided
+ that (i) the above copyright notices and this permission notice appear in
+ all copies of the software and related documentation, and (ii) the names of
+ Pixar, Sam Leffler and Silicon Graphics may not be used in any advertising or
+ publicity relating to the software without the specific, prior written
+ permission of Pixar, Sam Leffler and Silicon Graphics.
+ 
+ THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, 
+ EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY 
+ WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  
+ 
+ IN NO EVENT SHALL PIXAR, SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
+ ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
+ OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF 
+ LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE 
+ OF THIS SOFTWARE.
+
+--------------------------------------------------------------------
+
+ Copyright (c) 1997 Greg Ward Larson
+ Copyright (c) 1997 Silicon Graphics, Inc.
+
+ Permission to use, copy, modify, distribute, and sell this software and 
+ its documentation for any purpose is hereby granted without fee, provided
+ that (i) the above copyright notices and this permission notice appear in
+ all copies of the software and related documentation, and (ii) the names of
+ Sam Leffler, Greg Larson and Silicon Graphics may not be used in any
+ advertising or publicity relating to the software without the specific,
+ prior written permission of Sam Leffler, Greg Larson and Silicon Graphics.
+ 
+ THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, 
+ EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY 
+ WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  
+ 
+ IN NO EVENT SHALL SAM LEFFLER, GREG LARSON OR SILICON GRAPHICS BE LIABLE
+ FOR ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
+ OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF 
+ LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE 
+ OF THIS SOFTWARE.
+
+--------------------------------------------------------------------
+
+ Copyright 1990 by Digital Equipment Corporation, Maynard, Massachusetts.
+ Copyright 1991 by Digital Equipment Corporation, Maynard, Massachusetts.
+                        All Rights Reserved
+
+ Dan Sears
+ Chris Sears
+
+ Permission to use, copy, modify, and distribute this software and its
+ documentation for any purpose and without fee is hereby granted,
+ provided that the above copyright notice appear in all copies and that
+ both that copyright notice and this permission notice appear in
+ supporting documentation, and that the name of Digital not be
+ used in advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+
+ DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+ DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
+ ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+ SOFTWARE.
+ 
+--------------------------------------------------------------------
+
+ Copyright (c) 2000, Frank Warmerdam
+ Copyright (c) 1999, Frank Warmerdam
+
+ Permission is hereby granted, free of charge, to any person obtaining a
+ copy of this software and associated documentation files (the "Software"),
+ to deal in the Software without restriction, including without limitation
+ the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ and/or sell copies of the Software, and to permit persons to whom the
+ Software is furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be included
+ in all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ DEALINGS IN THE SOFTWARE.
+
+--------------------------------------------------------------------
+
+ Copyright (c) 1987, 1993, 1994
+ Copyright (c) 1990, 1993
+ Copyright (c) 1987, 1993
+ Copyright (c) 1989, 1993
+
+ This code is derived from software contributed to Berkeley by
+ Roger L. Snyder.
+
+	The Regents of the University of California.  All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+ 1. Redistributions of source code must retain the above copyright
+    notice, this list of conditions and the following disclaimer.
+ 2. Redistributions in binary form must reproduce the above copyright
+    notice, this list of conditions and the following disclaimer in the
+    documentation and/or other materials provided with the distribution.
+ 3. Neither the name of the University nor the names of its contributors
+    may be used to endorse or promote products derived from this software
+    without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ SUCH DAMAGE.
+
+--------------------------------------------------------------------
+
+ Copyright (c) 2003 Ross Finlayson
+
+ Permission to use, copy, modify, distribute, and sell this software and 
+ its documentation for any purpose is hereby granted without fee, provided
+ that (i) the above copyright notices and this permission notice appear in
+ all copies of the software and related documentation, and (ii) the name of
+ Ross Finlayson may not be used in any advertising or
+ publicity relating to the software without the specific, prior written
+ permission of Ross Finlayson.
+ 
+ THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, 
+ EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY 
+ WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  
+ 
+ IN NO EVENT SHALL ROSS FINLAYSON BE LIABLE FOR
+ ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
+ OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF 
+ LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE 
+ OF THIS SOFTWARE.
+ 
+--------------------------------------------------------------------
+
+ Copyright (c) 1988-1997 Sam Leffler
+ Copyright (c) 1991-1997 Silicon Graphics, Inc.
+ Copyright (c( 1996 USAF Phillips Laboratory
+ Copyright (c) 2002, Andrey Kiselev <[email protected]>
+ Copyright (c) 2004, Andrey Kiselev  <[email protected]>
+ Copyright (c) 2000, Frank Warmerdam
+
+ Permission to use, copy, modify, distribute, and sell this software and 
+ its documentation for any purpose is hereby granted without fee, provided
+ that (i) the above copyright notices and this permission notice appear in
+ all copies of the software and related documentation, and (ii) the names of
+ Sam Leffler and Silicon Graphics may not be used in any advertising or
+ publicity relating to the software without the specific, prior written
+ permission of Sam Leffler and Silicon Graphics.
+ 
+ THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, 
+ EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY 
+ WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  
+ 
+ IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
+ ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
+ OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF 
+ LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE 
+ OF THIS SOFTWARE.
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/desktop/libtiff/libtiff.p5m	Thu Mar 17 08:44:16 2016 -0700
@@ -0,0 +1,302 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+#
+
+
+<transform file path=usr/bin/(.*) -> set action.hash usr/bin/$(MACH64)/%<1>>
+<transform file path=usr.*/man/.+ -> default mangler.man.stability volatile>
+<transform file path=usr/share/man/man3tiff/(.*) -> set action.hash %<1>>
+
+
+set name=pkg.fmri \
+    value=pkg:/image/library/libtiff@$(IPS_COMPONENT_VERSION),$(BUILD_VERSION)
+set name=pkg.summary value="libtiff - library for reading and writing TIFF"
+set name=com.oracle.info.description value=libtiff
+set name=com.oracle.info.tpno value=$(TPNO)
+set name=info.classification \
+    value="org.opensolaris.category.2008:System/Multimedia Libraries"
+set name=info.source-url value=$(COMPONENT_ARCHIVE_URL)
+set name=info.upstream-url value=$(COMPONENT_PROJECT_URL)
+set name=org.opensolaris.arc-caseid value=PSARC/2013/134
+set name=org.opensolaris.consolidation value=$(CONSOLIDATION)
+
+
+file path=usr/bin/bmp2tiff
+file path=usr/bin/fax2ps
+file path=usr/bin/fax2tiff
+file path=usr/bin/gif2tiff
+file path=usr/bin/pal2rgb
+file path=usr/bin/ppm2tiff
+file path=usr/bin/ras2tiff
+file path=usr/bin/raw2tiff
+file path=usr/bin/rgb2ycbcr
+file path=usr/bin/thumbnail
+file path=usr/bin/tiff2bw
+file path=usr/bin/tiff2pdf
+file path=usr/bin/tiff2ps
+file path=usr/bin/tiff2rgba
+file path=usr/bin/tiffcmp
+file path=usr/bin/tiffcp
+file path=usr/bin/tiffcrop
+file path=usr/bin/tiffdither
+file path=usr/bin/tiffdump
+file path=usr/bin/tiffinfo
+file path=usr/bin/tiffmedian
+file path=usr/bin/tiffset
+file path=usr/bin/tiffsplit
+file path=usr/include/tiff.h
+file path=usr/include/tiffconf.h
+file path=usr/include/tiffio.h
+file path=usr/include/tiffvers.h
+link path=usr/lib/$(MACH64)/libtiff.so target=libtiff.so.5.2.0
+link path=usr/lib/$(MACH64)/libtiff.so.5 target=libtiff.so.5.2.0
+file path=usr/lib/$(MACH64)/libtiff.so.5.2.0
+file path=usr/lib/$(MACH64)/pkgconfig/libtiff-4.pc
+link path=usr/lib/libtiff.so target=libtiff.so.5.2.0
+link path=usr/lib/libtiff.so.5 target=libtiff.so.5.2.0
+file path=usr/lib/libtiff.so.5.2.0
+file path=usr/lib/pkgconfig/libtiff-4.pc
+dir  path=usr/share/doc/tiff-$(COMPONENT_VERSION)
+file path=usr/share/doc/tiff-$(COMPONENT_VERSION)/COPYRIGHT
+file path=usr/share/doc/tiff-$(COMPONENT_VERSION)/ChangeLog
+file path=usr/share/doc/tiff-$(COMPONENT_VERSION)/README
+file path=usr/share/doc/tiff-$(COMPONENT_VERSION)/README.vms
+file path=usr/share/doc/tiff-$(COMPONENT_VERSION)/RELEASE-DATE
+file path=usr/share/doc/tiff-$(COMPONENT_VERSION)/TODO
+file path=usr/share/doc/tiff-$(COMPONENT_VERSION)/VERSION
+dir  path=usr/share/doc/tiff-$(COMPONENT_VERSION)/html
+file path=usr/share/doc/tiff-$(COMPONENT_VERSION)/html/TIFFTechNote2.html
+file path=usr/share/doc/tiff-$(COMPONENT_VERSION)/html/addingtags.html
+file path=usr/share/doc/tiff-$(COMPONENT_VERSION)/html/bugs.html
+file path=usr/share/doc/tiff-$(COMPONENT_VERSION)/html/build.html
+file path=usr/share/doc/tiff-$(COMPONENT_VERSION)/html/contrib.html
+file path=usr/share/doc/tiff-$(COMPONENT_VERSION)/html/document.html
+dir  path=usr/share/doc/tiff-$(COMPONENT_VERSION)/html/images
+file path=usr/share/doc/tiff-$(COMPONENT_VERSION)/html/images.html
+file path=usr/share/doc/tiff-$(COMPONENT_VERSION)/html/images/back.gif
+file path=usr/share/doc/tiff-$(COMPONENT_VERSION)/html/images/bali.jpg
+file path=usr/share/doc/tiff-$(COMPONENT_VERSION)/html/images/cat.gif
+file path=usr/share/doc/tiff-$(COMPONENT_VERSION)/html/images/cover.jpg
+file path=usr/share/doc/tiff-$(COMPONENT_VERSION)/html/images/cramps.gif
+file path=usr/share/doc/tiff-$(COMPONENT_VERSION)/html/images/dave.gif
+file path=usr/share/doc/tiff-$(COMPONENT_VERSION)/html/images/info.gif
+file path=usr/share/doc/tiff-$(COMPONENT_VERSION)/html/images/jello.jpg
+file path=usr/share/doc/tiff-$(COMPONENT_VERSION)/html/images/jim.gif
+file path=usr/share/doc/tiff-$(COMPONENT_VERSION)/html/images/note.gif
+file path=usr/share/doc/tiff-$(COMPONENT_VERSION)/html/images/oxford.gif
+file path=usr/share/doc/tiff-$(COMPONENT_VERSION)/html/images/quad.jpg
+file path=usr/share/doc/tiff-$(COMPONENT_VERSION)/html/images/ring.gif
+file path=usr/share/doc/tiff-$(COMPONENT_VERSION)/html/images/smallliz.jpg
+file path=usr/share/doc/tiff-$(COMPONENT_VERSION)/html/images/strike.gif
+file path=usr/share/doc/tiff-$(COMPONENT_VERSION)/html/images/warning.gif
+file path=usr/share/doc/tiff-$(COMPONENT_VERSION)/html/index.html
+file path=usr/share/doc/tiff-$(COMPONENT_VERSION)/html/internals.html
+file path=usr/share/doc/tiff-$(COMPONENT_VERSION)/html/intro.html
+file path=usr/share/doc/tiff-$(COMPONENT_VERSION)/html/libtiff.html
+dir  path=usr/share/doc/tiff-$(COMPONENT_VERSION)/html/man
+file path=usr/share/doc/tiff-$(COMPONENT_VERSION)/html/man/TIFFClose.3tiff.html
+file path=usr/share/doc/tiff-$(COMPONENT_VERSION)/html/man/TIFFDataWidth.3tiff.html
+file path=usr/share/doc/tiff-$(COMPONENT_VERSION)/html/man/TIFFError.3tiff.html
+file path=usr/share/doc/tiff-$(COMPONENT_VERSION)/html/man/TIFFFieldDataType.3tiff.html
+file path=usr/share/doc/tiff-$(COMPONENT_VERSION)/html/man/TIFFFieldName.3tiff.html
+file path=usr/share/doc/tiff-$(COMPONENT_VERSION)/html/man/TIFFFieldPassCount.3tiff.html
+file path=usr/share/doc/tiff-$(COMPONENT_VERSION)/html/man/TIFFFieldReadCount.3tiff.html
+file path=usr/share/doc/tiff-$(COMPONENT_VERSION)/html/man/TIFFFieldTag.3tiff.html
+file path=usr/share/doc/tiff-$(COMPONENT_VERSION)/html/man/TIFFFieldWriteCount.3tiff.html
+file path=usr/share/doc/tiff-$(COMPONENT_VERSION)/html/man/TIFFFlush.3tiff.html
+file path=usr/share/doc/tiff-$(COMPONENT_VERSION)/html/man/TIFFGetField.3tiff.html
+file path=usr/share/doc/tiff-$(COMPONENT_VERSION)/html/man/TIFFOpen.3tiff.html
+file path=usr/share/doc/tiff-$(COMPONENT_VERSION)/html/man/TIFFPrintDirectory.3tiff.html
+file path=usr/share/doc/tiff-$(COMPONENT_VERSION)/html/man/TIFFRGBAImage.3tiff.html
+file path=usr/share/doc/tiff-$(COMPONENT_VERSION)/html/man/TIFFReadDirectory.3tiff.html
+file path=usr/share/doc/tiff-$(COMPONENT_VERSION)/html/man/TIFFReadEncodedStrip.3tiff.html
+file path=usr/share/doc/tiff-$(COMPONENT_VERSION)/html/man/TIFFReadEncodedTile.3tiff.html
+file path=usr/share/doc/tiff-$(COMPONENT_VERSION)/html/man/TIFFReadRGBAImage.3tiff.html
+file path=usr/share/doc/tiff-$(COMPONENT_VERSION)/html/man/TIFFReadRGBAStrip.3tiff.html
+file path=usr/share/doc/tiff-$(COMPONENT_VERSION)/html/man/TIFFReadRGBATile.3tiff.html
+file path=usr/share/doc/tiff-$(COMPONENT_VERSION)/html/man/TIFFReadRawStrip.3tiff.html
+file path=usr/share/doc/tiff-$(COMPONENT_VERSION)/html/man/TIFFReadRawTile.3tiff.html
+file path=usr/share/doc/tiff-$(COMPONENT_VERSION)/html/man/TIFFReadScanline.3tiff.html
+file path=usr/share/doc/tiff-$(COMPONENT_VERSION)/html/man/TIFFReadTile.3tiff.html
+file path=usr/share/doc/tiff-$(COMPONENT_VERSION)/html/man/TIFFSetDirectory.3tiff.html
+file path=usr/share/doc/tiff-$(COMPONENT_VERSION)/html/man/TIFFSetField.3tiff.html
+file path=usr/share/doc/tiff-$(COMPONENT_VERSION)/html/man/TIFFWarning.3tiff.html
+file path=usr/share/doc/tiff-$(COMPONENT_VERSION)/html/man/TIFFWriteDirectory.3tiff.html
+file path=usr/share/doc/tiff-$(COMPONENT_VERSION)/html/man/TIFFWriteEncodedStrip.3tiff.html
+file path=usr/share/doc/tiff-$(COMPONENT_VERSION)/html/man/TIFFWriteEncodedTile.3tiff.html
+file path=usr/share/doc/tiff-$(COMPONENT_VERSION)/html/man/TIFFWriteRawStrip.3tiff.html
+file path=usr/share/doc/tiff-$(COMPONENT_VERSION)/html/man/TIFFWriteRawTile.3tiff.html
+file path=usr/share/doc/tiff-$(COMPONENT_VERSION)/html/man/TIFFWriteScanline.3tiff.html
+file path=usr/share/doc/tiff-$(COMPONENT_VERSION)/html/man/TIFFWriteTile.3tiff.html
+file path=usr/share/doc/tiff-$(COMPONENT_VERSION)/html/man/TIFFbuffer.3tiff.html
+file path=usr/share/doc/tiff-$(COMPONENT_VERSION)/html/man/TIFFcodec.3tiff.html
+file path=usr/share/doc/tiff-$(COMPONENT_VERSION)/html/man/TIFFcolor.3tiff.html
+file path=usr/share/doc/tiff-$(COMPONENT_VERSION)/html/man/TIFFmemory.3tiff.html
+file path=usr/share/doc/tiff-$(COMPONENT_VERSION)/html/man/TIFFquery.3tiff.html
+file path=usr/share/doc/tiff-$(COMPONENT_VERSION)/html/man/TIFFsize.3tiff.html
+file path=usr/share/doc/tiff-$(COMPONENT_VERSION)/html/man/TIFFstrip.3tiff.html
+file path=usr/share/doc/tiff-$(COMPONENT_VERSION)/html/man/TIFFswab.3tiff.html
+file path=usr/share/doc/tiff-$(COMPONENT_VERSION)/html/man/TIFFtile.3tiff.html
+file path=usr/share/doc/tiff-$(COMPONENT_VERSION)/html/man/bmp2tiff.1.html
+file path=usr/share/doc/tiff-$(COMPONENT_VERSION)/html/man/fax2ps.1.html
+file path=usr/share/doc/tiff-$(COMPONENT_VERSION)/html/man/fax2tiff.1.html
+file path=usr/share/doc/tiff-$(COMPONENT_VERSION)/html/man/gif2tiff.1.html
+file path=usr/share/doc/tiff-$(COMPONENT_VERSION)/html/man/index.html
+file path=usr/share/doc/tiff-$(COMPONENT_VERSION)/html/man/libtiff.3tiff.html
+file path=usr/share/doc/tiff-$(COMPONENT_VERSION)/html/man/pal2rgb.1.html
+file path=usr/share/doc/tiff-$(COMPONENT_VERSION)/html/man/ppm2tiff.1.html
+file path=usr/share/doc/tiff-$(COMPONENT_VERSION)/html/man/ras2tiff.1.html
+file path=usr/share/doc/tiff-$(COMPONENT_VERSION)/html/man/raw2tiff.1.html
+file path=usr/share/doc/tiff-$(COMPONENT_VERSION)/html/man/rgb2ycbcr.1.html
+file path=usr/share/doc/tiff-$(COMPONENT_VERSION)/html/man/sgi2tiff.1.html
+file path=usr/share/doc/tiff-$(COMPONENT_VERSION)/html/man/thumbnail.1.html
+file path=usr/share/doc/tiff-$(COMPONENT_VERSION)/html/man/tiff2bw.1.html
+file path=usr/share/doc/tiff-$(COMPONENT_VERSION)/html/man/tiff2pdf.1.html
+file path=usr/share/doc/tiff-$(COMPONENT_VERSION)/html/man/tiff2ps.1.html
+file path=usr/share/doc/tiff-$(COMPONENT_VERSION)/html/man/tiff2rgba.1.html
+file path=usr/share/doc/tiff-$(COMPONENT_VERSION)/html/man/tiffcmp.1.html
+file path=usr/share/doc/tiff-$(COMPONENT_VERSION)/html/man/tiffcp.1.html
+file path=usr/share/doc/tiff-$(COMPONENT_VERSION)/html/man/tiffcrop.1.html
+file path=usr/share/doc/tiff-$(COMPONENT_VERSION)/html/man/tiffdither.1.html
+file path=usr/share/doc/tiff-$(COMPONENT_VERSION)/html/man/tiffdump.1.html
+file path=usr/share/doc/tiff-$(COMPONENT_VERSION)/html/man/tiffgt.1.html
+file path=usr/share/doc/tiff-$(COMPONENT_VERSION)/html/man/tiffinfo.1.html
+file path=usr/share/doc/tiff-$(COMPONENT_VERSION)/html/man/tiffmedian.1.html
+file path=usr/share/doc/tiff-$(COMPONENT_VERSION)/html/man/tiffset.1.html
+file path=usr/share/doc/tiff-$(COMPONENT_VERSION)/html/man/tiffsplit.1.html
+file path=usr/share/doc/tiff-$(COMPONENT_VERSION)/html/man/tiffsv.1.html
+file path=usr/share/doc/tiff-$(COMPONENT_VERSION)/html/misc.html
+file path=usr/share/doc/tiff-$(COMPONENT_VERSION)/html/support.html
+file path=usr/share/doc/tiff-$(COMPONENT_VERSION)/html/tools.html
+file path=usr/share/doc/tiff-$(COMPONENT_VERSION)/html/v3.4beta007.html
+file path=usr/share/doc/tiff-$(COMPONENT_VERSION)/html/v3.4beta016.html
+file path=usr/share/doc/tiff-$(COMPONENT_VERSION)/html/v3.4beta018.html
+file path=usr/share/doc/tiff-$(COMPONENT_VERSION)/html/v3.4beta024.html
+file path=usr/share/doc/tiff-$(COMPONENT_VERSION)/html/v3.4beta028.html
+file path=usr/share/doc/tiff-$(COMPONENT_VERSION)/html/v3.4beta029.html
+file path=usr/share/doc/tiff-$(COMPONENT_VERSION)/html/v3.4beta031.html
+file path=usr/share/doc/tiff-$(COMPONENT_VERSION)/html/v3.4beta032.html
+file path=usr/share/doc/tiff-$(COMPONENT_VERSION)/html/v3.4beta033.html
+file path=usr/share/doc/tiff-$(COMPONENT_VERSION)/html/v3.4beta034.html
+file path=usr/share/doc/tiff-$(COMPONENT_VERSION)/html/v3.4beta035.html
+file path=usr/share/doc/tiff-$(COMPONENT_VERSION)/html/v3.4beta036.html
+file path=usr/share/doc/tiff-$(COMPONENT_VERSION)/html/v3.5.1.html
+file path=usr/share/doc/tiff-$(COMPONENT_VERSION)/html/v3.5.2.html
+file path=usr/share/doc/tiff-$(COMPONENT_VERSION)/html/v3.5.3.html
+file path=usr/share/doc/tiff-$(COMPONENT_VERSION)/html/v3.5.4.html
+file path=usr/share/doc/tiff-$(COMPONENT_VERSION)/html/v3.5.5.html
+file path=usr/share/doc/tiff-$(COMPONENT_VERSION)/html/v3.5.6-beta.html
+file path=usr/share/doc/tiff-$(COMPONENT_VERSION)/html/v3.5.7.html
+file path=usr/share/doc/tiff-$(COMPONENT_VERSION)/html/v3.6.0.html
+file path=usr/share/doc/tiff-$(COMPONENT_VERSION)/html/v3.6.1.html
+file path=usr/share/doc/tiff-$(COMPONENT_VERSION)/html/v3.7.0.html
+file path=usr/share/doc/tiff-$(COMPONENT_VERSION)/html/v3.7.0alpha.html
+file path=usr/share/doc/tiff-$(COMPONENT_VERSION)/html/v3.7.0beta.html
+file path=usr/share/doc/tiff-$(COMPONENT_VERSION)/html/v3.7.0beta2.html
+file path=usr/share/doc/tiff-$(COMPONENT_VERSION)/html/v3.7.1.html
+file path=usr/share/doc/tiff-$(COMPONENT_VERSION)/html/v3.7.2.html
+file path=usr/share/doc/tiff-$(COMPONENT_VERSION)/html/v3.7.3.html
+file path=usr/share/doc/tiff-$(COMPONENT_VERSION)/html/v3.7.4.html
+file path=usr/share/doc/tiff-$(COMPONENT_VERSION)/html/v3.8.0.html
+file path=usr/share/doc/tiff-$(COMPONENT_VERSION)/html/v3.8.1.html
+file path=usr/share/doc/tiff-$(COMPONENT_VERSION)/html/v3.8.2.html
+file path=usr/share/doc/tiff-$(COMPONENT_VERSION)/html/v3.9.0beta.html
+file path=usr/share/doc/tiff-$(COMPONENT_VERSION)/html/v3.9.1.html
+file path=usr/share/doc/tiff-$(COMPONENT_VERSION)/html/v3.9.2.html
+file path=usr/share/doc/tiff-$(COMPONENT_VERSION)/html/v4.0.0.html
+file path=usr/share/doc/tiff-$(COMPONENT_VERSION)/html/v4.0.1.html
+file path=usr/share/doc/tiff-$(COMPONENT_VERSION)/html/v4.0.2.html
+file path=usr/share/man/man1/bmp2tiff.1
+file path=usr/share/man/man1/fax2ps.1
+file path=usr/share/man/man1/fax2tiff.1
+file path=usr/share/man/man1/gif2tiff.1
+file path=usr/share/man/man1/pal2rgb.1
+file path=usr/share/man/man1/ppm2tiff.1
+file path=usr/share/man/man1/ras2tiff.1
+file path=usr/share/man/man1/raw2tiff.1
+file path=usr/share/man/man1/rgb2ycbcr.1
+file path=usr/share/man/man1/sgi2tiff.1
+file path=usr/share/man/man1/thumbnail.1
+file path=usr/share/man/man1/tiff2bw.1
+file path=usr/share/man/man1/tiff2pdf.1
+file path=usr/share/man/man1/tiff2ps.1
+file path=usr/share/man/man1/tiff2rgba.1
+file path=usr/share/man/man1/tiffcmp.1
+file path=usr/share/man/man1/tiffcp.1
+file path=usr/share/man/man1/tiffcrop.1
+file path=usr/share/man/man1/tiffdither.1
+file path=usr/share/man/man1/tiffdump.1
+file path=usr/share/man/man1/tiffgt.1
+file path=usr/share/man/man1/tiffinfo.1
+file path=usr/share/man/man1/tiffmedian.1
+file path=usr/share/man/man1/tiffset.1
+file path=usr/share/man/man1/tiffsplit.1
+file path=usr/share/man/man1/tiffsv.1
+dir  path=usr/share/man/man3tiff
+file path=usr/share/man/man3tiff/TIFFClose.3tiff
+file path=usr/share/man/man3tiff/TIFFDataWidth.3tiff
+file path=usr/share/man/man3tiff/TIFFError.3tiff
+file path=usr/share/man/man3tiff/TIFFFieldDataType.3tiff
+file path=usr/share/man/man3tiff/TIFFFieldName.3tiff
+file path=usr/share/man/man3tiff/TIFFFieldPassCount.3tiff
+file path=usr/share/man/man3tiff/TIFFFieldReadCount.3tiff
+file path=usr/share/man/man3tiff/TIFFFieldTag.3tiff
+file path=usr/share/man/man3tiff/TIFFFieldWriteCount.3tiff
+file path=usr/share/man/man3tiff/TIFFFlush.3tiff
+file path=usr/share/man/man3tiff/TIFFGetField.3tiff
+file path=usr/share/man/man3tiff/TIFFOpen.3tiff
+file path=usr/share/man/man3tiff/TIFFPrintDirectory.3tiff
+file path=usr/share/man/man3tiff/TIFFRGBAImage.3tiff
+file path=usr/share/man/man3tiff/TIFFReadDirectory.3tiff
+file path=usr/share/man/man3tiff/TIFFReadEncodedStrip.3tiff
+file path=usr/share/man/man3tiff/TIFFReadEncodedTile.3tiff
+file path=usr/share/man/man3tiff/TIFFReadRGBAImage.3tiff
+file path=usr/share/man/man3tiff/TIFFReadRGBAStrip.3tiff
+file path=usr/share/man/man3tiff/TIFFReadRGBATile.3tiff
+file path=usr/share/man/man3tiff/TIFFReadRawStrip.3tiff
+file path=usr/share/man/man3tiff/TIFFReadRawTile.3tiff
+file path=usr/share/man/man3tiff/TIFFReadScanline.3tiff
+file path=usr/share/man/man3tiff/TIFFReadTile.3tiff
+file path=usr/share/man/man3tiff/TIFFSetDirectory.3tiff
+file path=usr/share/man/man3tiff/TIFFSetField.3tiff
+file path=usr/share/man/man3tiff/TIFFWarning.3tiff
+file path=usr/share/man/man3tiff/TIFFWriteDirectory.3tiff
+file path=usr/share/man/man3tiff/TIFFWriteEncodedStrip.3tiff
+file path=usr/share/man/man3tiff/TIFFWriteEncodedTile.3tiff
+file path=usr/share/man/man3tiff/TIFFWriteRawStrip.3tiff
+file path=usr/share/man/man3tiff/TIFFWriteRawTile.3tiff
+file path=usr/share/man/man3tiff/TIFFWriteScanline.3tiff
+file path=usr/share/man/man3tiff/TIFFWriteTile.3tiff
+file path=usr/share/man/man3tiff/TIFFbuffer.3tiff
+file path=usr/share/man/man3tiff/TIFFcodec.3tiff
+file path=usr/share/man/man3tiff/TIFFcolor.3tiff
+file path=usr/share/man/man3tiff/TIFFmemory.3tiff
+file path=usr/share/man/man3tiff/TIFFquery.3tiff
+file path=usr/share/man/man3tiff/TIFFsize.3tiff
+file path=usr/share/man/man3tiff/TIFFstrip.3tiff
+file path=usr/share/man/man3tiff/TIFFswab.3tiff
+file path=usr/share/man/man3tiff/TIFFtile.3tiff
+file path=usr/share/man/man3tiff/libtiff.3tiff
+
+license libtiff.license license="MIT, BSD"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/desktop/libtiff/patches/test-driver.patch	Thu Mar 17 08:44:16 2016 -0700
@@ -0,0 +1,23 @@
+internal patch; not suitable for upstream
+
+--- tiff-4.0.4/config/test-driver~	2012-08-19 09:57:23.000000000 -0700
++++ tiff-4.0.4/config/test-driver	2015-07-13 00:47:17.600616189 -0700
+@@ -1,7 +1,7 @@
+ #! /bin/sh
+ # test-driver - basic driver script for the 'parallel-tests' mode.
+ 
+-scriptversion=2012-06-27.10; # UTC
++scriptversion=2015-07-13.07; # UTC
+ 
+ # Copyright (C) 2011-2012 Free Software Foundation, Inc.
+ #
+@@ -29,7 +29,8 @@
+ 
+ # Make unconditional expansion of undefined variables an error.  This
+ # helps a lot in preventing typo-related bugs.
+-set -u
++# ... but breaks libtool's wrapper scripts.
++set +u
+ 
+ usage_error ()
+ {
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/desktop/libtiff/patches/tiff-01-CVE-2013-1961.patch	Thu Mar 17 08:44:16 2016 -0700
@@ -0,0 +1,749 @@
+We should be able to remove this patch once we update to the most recent version of libtiff
+
+--- tiff-4.0.3/contrib/dbs/xtiff/xtiff.c.orig	2013-06-06 12:47:34.714111498 +0530
++++ tiff-4.0.3/contrib/dbs/xtiff/xtiff.c	2013-06-06 12:49:20.408485154 +0530
+@@ -512,9 +512,9 @@ SetNameLabel()
+     Arg args[1];
+ 
+     if (tfMultiPage)
+-        sprintf(buffer, "%s - page %d", fileName, tfDirectory);
++        snprintf(buffer, sizeof(buffer), "%s - page %d", fileName, tfDirectory);
+     else
+-        strcpy(buffer, fileName);
++        snprintf(buffer, sizeof(buffer), "%s", fileName);
+     XtSetArg(args[0], XtNlabel, buffer);
+     XtSetValues(labelWidget, args, 1);
+ }
+--- tiff-4.0.3/libtiff/tif_codec.c.orig	2013-06-06 12:49:41.348095818 +0530
++++ tiff-4.0.3/libtiff/tif_codec.c	2013-06-06 14:26:15.379735150 +0530
+@@ -108,7 +108,8 @@ _notConfigured(TIFF* tif)
+ 	const TIFFCodec* c = TIFFFindCODEC(tif->tif_dir.td_compression);
+         char compression_code[20];
+         
+-        sprintf( compression_code, "%d", tif->tif_dir.td_compression );
++        snprintf(compression_code, sizeof(compression_code), "%d", tif->tif_dir.td_compression );
++
+ 	TIFFErrorExt(tif->tif_clientdata, tif->tif_name,
+                      "%s compression support is not configured", 
+                      c ? c->name : compression_code );
+--- tiff-4.0.3/libtiff/tif_dirinfo.c.orig	2013-06-06 14:26:48.006400716 +0530
++++ tiff-4.0.3/libtiff/tif_dirinfo.c	2013-06-06 14:27:40.008028688 +0530
+@@ -711,8 +711,7 @@ _TIFFCreateAnonField(TIFF *tif, uint32 t
+ 	 * note that this name is a special sign to TIFFClose() and
+ 	 * _TIFFSetupFields() to free the field
+ 	 */
+-	sprintf(fld->field_name, "Tag %d", (int) tag);
+-
++	snprintf(fld->field_name, 32, "Tag %d", (int) tag);
+ 	return fld;    
+ }
+ 
+--- tiff-4.0.3/tools/tiff2bw.c.orig	2013-06-06 14:29:02.323381540 +0530
++++ tiff-4.0.3/tools/tiff2bw.c	2013-06-06 14:35:24.717005862 +0530
+@@ -205,7 +205,7 @@ main(int argc, char* argv[])
+ 		}
+ 	}
+ 	TIFFSetField(out, TIFFTAG_PHOTOMETRIC, PHOTOMETRIC_MINISBLACK);
+-	sprintf(thing, "B&W version of %s", argv[optind]);
++	snprintf(thing, sizeof(thing), "B&W version of %s", argv[optind]);
+ 	TIFFSetField(out, TIFFTAG_IMAGEDESCRIPTION, thing);
+ 	TIFFSetField(out, TIFFTAG_SOFTWARE, "tiff2bw");
+ 	outbuf = (unsigned char *)_TIFFmalloc(TIFFScanlineSize(out));
+--- tiff-4.0.3/tools/tiff2pdf.c.orig	2013-06-06 14:35:39.432935438 +0530
++++ tiff-4.0.3/tools/tiff2pdf.c	2013-06-07 10:31:36.523895959 +0530
+@@ -3610,6 +3610,8 @@ tsize_t t2p_write_pdf_header(T2P* t2p, T
+ 	int buflen=0;
+ 	
+ 	buflen=sprintf(buffer, "%%PDF-%u.%u ", t2p->pdf_majorversion&0xff, t2p->pdf_minorversion&0xff);
++	buflen = snprintf(buffer, sizeof(buffer), "%%PDF-%u.%u ", t2p->pdf_majorversion&0xff, t2p->pdf_minorversion&0xff);
++
+ 	written += t2pWriteFile(output, (tdata_t) buffer, buflen);
+ 	written += t2pWriteFile(output, (tdata_t)"\n%\342\343\317\323\n", 7);
+ 
+@@ -3623,10 +3625,10 @@ tsize_t t2p_write_pdf_header(T2P* t2p, T
+ tsize_t t2p_write_pdf_obj_start(uint32 number, TIFF* output){
+ 
+ 	tsize_t written=0;
+-	char buffer[16];
++	char buffer[32];
+ 	int buflen=0;
+ 
+-	buflen=sprintf(buffer, "%lu", (unsigned long)number);
++	buflen=snprintf(buffer, sizeof(buffer), "%lu", (unsigned long)number);
+ 	written += t2pWriteFile(output, (tdata_t) buffer, buflen );
+ 	written += t2pWriteFile(output, (tdata_t) " 0 obj\n", 7);
+ 
+@@ -3665,13 +3667,13 @@ tsize_t t2p_write_pdf_name(unsigned char
+ 	written += t2pWriteFile(output, (tdata_t) "/", 1);
+ 	for (i=0;i<namelen;i++){
+ 		if ( ((unsigned char)name[i]) < 0x21){
+-			sprintf(buffer, "#%.2X", name[i]);
++			snprintf(buffer, sizeof(buffer), "#%.2X", name[i]);
+ 			buffer[sizeof(buffer) - 1] = '\0';
+ 			written += t2pWriteFile(output, (tdata_t) buffer, 3);
+ 			nextchar=1;
+ 		}
+ 		if ( ((unsigned char)name[i]) > 0x7E){
+-			sprintf(buffer, "#%.2X", name[i]);
++			snprintf(buffer, sizeof(buffer), "#%.2X", name[i]);
+ 			buffer[sizeof(buffer) - 1] = '\0';
+ 			written += t2pWriteFile(output, (tdata_t) buffer, 3);
+ 			nextchar=1;
+@@ -3679,57 +3681,57 @@ tsize_t t2p_write_pdf_name(unsigned char
+ 		if (nextchar==0){
+ 			switch (name[i]){
+ 				case 0x23:
+-					sprintf(buffer, "#%.2X", name[i]);
++					snprintf(buffer, sizeof(buffer), "#%.2X", name[i]);
+ 					buffer[sizeof(buffer) - 1] = '\0';
+ 					written += t2pWriteFile(output, (tdata_t) buffer, 3);
+ 					break;
+ 				case 0x25:
+-					sprintf(buffer, "#%.2X", name[i]);
++					snprintf(buffer, sizeof(buffer), "#%.2X", name[i]);
+ 					buffer[sizeof(buffer) - 1] = '\0';
+ 					written += t2pWriteFile(output, (tdata_t) buffer, 3);
+ 					break;
+ 				case 0x28:
+-					sprintf(buffer, "#%.2X", name[i]);
++					snprintf(buffer, sizeof(buffer), "#%.2X", name[i]);
+ 					buffer[sizeof(buffer) - 1] = '\0';
+ 					written += t2pWriteFile(output, (tdata_t) buffer, 3);
+ 					break;
+ 				case 0x29:
+-					sprintf(buffer, "#%.2X", name[i]); 
++					snprintf(buffer, sizeof(buffer), "#%.2X", name[i]);
+ 					buffer[sizeof(buffer) - 1] = '\0';
+ 					written += t2pWriteFile(output, (tdata_t) buffer, 3);
+ 					break;
+ 				case 0x2F:
+-					sprintf(buffer, "#%.2X", name[i]); 
++					snprintf(buffer, sizeof(buffer), "#%.2X", name[i]);
+ 					buffer[sizeof(buffer) - 1] = '\0';
+ 					written += t2pWriteFile(output, (tdata_t) buffer, 3);
+ 					break;
+ 				case 0x3C:
+-					sprintf(buffer, "#%.2X", name[i]); 
++					snprintf(buffer, sizeof(buffer), "#%.2X", name[i]);
+ 					buffer[sizeof(buffer) - 1] = '\0';
+ 					written += t2pWriteFile(output, (tdata_t) buffer, 3);
+ 					break;
+ 				case 0x3E:
+-					sprintf(buffer, "#%.2X", name[i]);
++					snprintf(buffer, sizeof(buffer), "#%.2X", name[i]);
+ 					buffer[sizeof(buffer) - 1] = '\0';
+ 					written += t2pWriteFile(output, (tdata_t) buffer, 3);
+ 					break;
+ 				case 0x5B:
+-					sprintf(buffer, "#%.2X", name[i]); 
++					snprintf(buffer, sizeof(buffer), "#%.2X", name[i]);
+ 					buffer[sizeof(buffer) - 1] = '\0';
+ 					written += t2pWriteFile(output, (tdata_t) buffer, 3);
+ 					break;
+ 				case 0x5D:
+-					sprintf(buffer, "#%.2X", name[i]);
++					snprintf(buffer, sizeof(buffer), "#%.2X", name[i]);
+ 					buffer[sizeof(buffer) - 1] = '\0';
+ 					written += t2pWriteFile(output, (tdata_t) buffer, 3);
+ 					break;
+ 				case 0x7B:
+-					sprintf(buffer, "#%.2X", name[i]); 
++					snprintf(buffer, sizeof(buffer), "#%.2X", name[i]);
+ 					buffer[sizeof(buffer) - 1] = '\0';
+ 					written += t2pWriteFile(output, (tdata_t) buffer, 3);
+ 					break;
+ 				case 0x7D:
+-					sprintf(buffer, "#%.2X", name[i]); 
++					snprintf(buffer, sizeof(buffer), "#%.2X", name[i]);
+ 					buffer[sizeof(buffer) - 1] = '\0';
+ 					written += t2pWriteFile(output, (tdata_t) buffer, 3);
+ 					break;
+@@ -3844,14 +3846,14 @@ tsize_t t2p_write_pdf_stream_end(TIFF* o
+ tsize_t t2p_write_pdf_stream_dict(tsize_t len, uint32 number, TIFF* output){
+ 	
+ 	tsize_t written=0;
+-	char buffer[16];
++	char buffer[32];
+ 	int buflen=0;
+ 	
+ 	written += t2pWriteFile(output, (tdata_t) "/Length ", 8);
+ 	if(len!=0){
+ 		written += t2p_write_pdf_stream_length(len, output);
+ 	} else {
+-		buflen=sprintf(buffer, "%lu", (unsigned long)number);
++		buflen=snprintf(buffer, sizeof(buffer), "%lu", (unsigned long)number);
+ 		written += t2pWriteFile(output, (tdata_t) buffer, buflen);
+ 		written += t2pWriteFile(output, (tdata_t) " 0 R \n", 6);
+ 	}
+@@ -3892,10 +3894,10 @@ tsize_t t2p_write_pdf_stream_dict_end(TI
+ tsize_t t2p_write_pdf_stream_length(tsize_t len, TIFF* output){
+ 
+ 	tsize_t written=0;
+-	char buffer[16];
++	char buffer[32];
+ 	int buflen=0;
+ 
+-	buflen=sprintf(buffer, "%lu", (unsigned long)len);
++	buflen=snprintf(buffer, sizeof(buffer), "%lu", (unsigned long)len);
+ 	written += t2pWriteFile(output, (tdata_t) buffer, buflen);
+ 	written += t2pWriteFile(output, (tdata_t) "\n", 1);
+ 
+@@ -3909,7 +3911,7 @@ tsize_t t2p_write_pdf_stream_length(tsiz
+ tsize_t t2p_write_pdf_catalog(T2P* t2p, TIFF* output)
+ {
+ 	tsize_t written = 0;
+-	char buffer[16];
++	char buffer[32];
+ 	int buflen = 0;
+ 
+ 	written += t2pWriteFile(output, 
+@@ -3948,7 +3950,6 @@ tsize_t t2p_write_pdf_info(T2P* t2p, TIF
+ 		written += t2p_write_pdf_string(t2p->pdf_datetime, output);
+ 	}
+ 	written += t2pWriteFile(output, (tdata_t) "\n/Producer ", 11);
+-	_TIFFmemset((tdata_t)buffer, 0x00, sizeof(buffer));
+ 	snprintf(buffer, sizeof(buffer), "libtiff / tiff2pdf - %d", TIFFLIB_VERSION);
+ 	written += t2p_write_pdf_string(buffer, output);
+ 	written += t2pWriteFile(output, (tdata_t) "\n", 1);
+@@ -4089,7 +4090,7 @@ tsize_t t2p_write_pdf_pages(T2P* t2p, TI
+ {
+ 	tsize_t written=0;
+ 	tdir_t i=0;
+-	char buffer[16];
++	char buffer[32];
+ 	int buflen=0;
+ 
+ 	int page=0;
+@@ -4097,7 +4098,7 @@ tsize_t t2p_write_pdf_pages(T2P* t2p, TI
+ 		(tdata_t) "<< \n/Type /Pages \n/Kids [ ", 26);
+ 	page = t2p->pdf_pages+1;
+ 	for (i=0;i<t2p->tiff_pagecount;i++){
+-		buflen=sprintf(buffer, "%d", page);
++		buflen=snprintf(buffer, sizeof(buffer), "%d", page);
+ 		written += t2pWriteFile(output, (tdata_t) buffer, buflen);
+ 		written += t2pWriteFile(output, (tdata_t) " 0 R ", 5);
+ 		if ( ((i+1)%8)==0 ) {
+@@ -4112,8 +4113,7 @@ tsize_t t2p_write_pdf_pages(T2P* t2p, TI
+ 		}
+ 	}
+ 	written += t2pWriteFile(output, (tdata_t) "] \n/Count ", 10);
+-	_TIFFmemset(buffer, 0x00, 16);
+-	buflen=sprintf(buffer, "%d", t2p->tiff_pagecount);
++	buflen=snprintf(buffer, sizeof(buffer), "%d", t2p->tiff_pagecount);
+ 	written += t2pWriteFile(output, (tdata_t) buffer, buflen);
+ 	written += t2pWriteFile(output, (tdata_t) " \n>> \n", 6);
+ 
+@@ -4128,28 +4128,28 @@ tsize_t t2p_write_pdf_page(uint32 object
+ 
+ 	unsigned int i=0;
+ 	tsize_t written=0;
+-	char buffer[16];
++	char buffer[256];
+ 	int buflen=0;
+ 
+ 	written += t2pWriteFile(output, (tdata_t) "<<\n/Type /Page \n/Parent ", 24);
+-	buflen=sprintf(buffer, "%lu", (unsigned long)t2p->pdf_pages);
++	buflen=snprintf(buffer, sizeof(buffer), "%lu", (unsigned long)t2p->pdf_pages);
+ 	written += t2pWriteFile(output, (tdata_t) buffer, buflen);
+ 	written += t2pWriteFile(output, (tdata_t) " 0 R \n", 6);
+ 	written += t2pWriteFile(output, (tdata_t) "/MediaBox [", 11); 
+-	buflen=sprintf(buffer, "%.4f",t2p->pdf_mediabox.x1);
++	buflen=snprintf(buffer, sizeof(buffer), "%.4f",t2p->pdf_mediabox.x1);
+ 	written += t2pWriteFile(output, (tdata_t) buffer, buflen);
+ 	written += t2pWriteFile(output, (tdata_t) " ", 1); 
+-	buflen=sprintf(buffer, "%.4f",t2p->pdf_mediabox.y1);
++	buflen=snprintf(buffer, sizeof(buffer), "%.4f",t2p->pdf_mediabox.y1);
+ 	written += t2pWriteFile(output, (tdata_t) buffer, buflen);
+ 	written += t2pWriteFile(output, (tdata_t) " ", 1); 
+-	buflen=sprintf(buffer, "%.4f",t2p->pdf_mediabox.x2);
++	buflen=snprintf(buffer, sizeof(buffer), "%.4f",t2p->pdf_mediabox.x2);
+ 	written += t2pWriteFile(output, (tdata_t) buffer, buflen);
+ 	written += t2pWriteFile(output, (tdata_t) " ", 1); 
+-	buflen=sprintf(buffer, "%.4f",t2p->pdf_mediabox.y2);
++	buflen=snprintf(buffer, sizeof(buffer), "%.4f",t2p->pdf_mediabox.y2);
+ 	written += t2pWriteFile(output, (tdata_t) buffer, buflen);
+ 	written += t2pWriteFile(output, (tdata_t) "] \n", 3); 
+ 	written += t2pWriteFile(output, (tdata_t) "/Contents ", 10);
+-	buflen=sprintf(buffer, "%lu", (unsigned long)(object + 1));
++	buflen=snprintf(buffer, sizeof(buffer), "%lu", (unsigned long)(object + 1));
+ 	written += t2pWriteFile(output, (tdata_t) buffer, buflen);
+ 	written += t2pWriteFile(output, (tdata_t) " 0 R \n", 6);
+ 	written += t2pWriteFile(output, (tdata_t) "/Resources << \n", 15);
+@@ -4157,15 +4157,13 @@ tsize_t t2p_write_pdf_page(uint32 object
+ 		written += t2pWriteFile(output, (tdata_t) "/XObject <<\n", 12);
+ 		for(i=0;i<t2p->tiff_tiles[t2p->pdf_page].tiles_tilecount;i++){
+ 			written += t2pWriteFile(output, (tdata_t) "/Im", 3);
+-			buflen = sprintf(buffer, "%u", t2p->pdf_page+1);
++			buflen = snprintf(buffer, sizeof(buffer), "%u", t2p->pdf_page+1);
+ 			written += t2pWriteFile(output, (tdata_t) buffer, buflen);
+ 			written += t2pWriteFile(output, (tdata_t) "_", 1);
+-			buflen = sprintf(buffer, "%u", i+1);
++			buflen = snprintf(buffer, sizeof(buffer), "%u", i+1);
+ 			written += t2pWriteFile(output, (tdata_t) buffer, buflen);
+ 			written += t2pWriteFile(output, (tdata_t) " ", 1);
+-			buflen = sprintf(
+-				buffer, 
+-				"%lu", 
++			buflen = snprintf(buffer, sizeof(buffer), "%lu",
+ 				(unsigned long)(object+3+(2*i)+t2p->tiff_pages[t2p->pdf_page].page_extra)); 
+ 			written += t2pWriteFile(output, (tdata_t) buffer, buflen);
+ 			written += t2pWriteFile(output, (tdata_t) " 0 R ", 5);
+@@ -4177,12 +4175,10 @@ tsize_t t2p_write_pdf_page(uint32 object
+ 	} else {
+ 			written += t2pWriteFile(output, (tdata_t) "/XObject <<\n", 12);
+ 			written += t2pWriteFile(output, (tdata_t) "/Im", 3);
+-			buflen = sprintf(buffer, "%u", t2p->pdf_page+1);
++			buflen = snprintf(buffer, sizeof(buffer), "%u", t2p->pdf_page+1);
+ 			written += t2pWriteFile(output, (tdata_t) buffer, buflen);
+ 			written += t2pWriteFile(output, (tdata_t) " ", 1);
+-			buflen = sprintf(
+-				buffer, 
+-				"%lu", 
++			buflen = snprintf(buffer, sizeof(buffer), "%lu",
+ 				(unsigned long)(object+3+(2*i)+t2p->tiff_pages[t2p->pdf_page].page_extra)); 
+ 			written += t2pWriteFile(output, (tdata_t) buffer, buflen);
+ 			written += t2pWriteFile(output, (tdata_t) " 0 R ", 5);
+@@ -4191,9 +4187,7 @@ tsize_t t2p_write_pdf_page(uint32 object
+ 	if(t2p->tiff_transferfunctioncount != 0) {
+ 		written += t2pWriteFile(output, (tdata_t) "/ExtGState <<", 13);
+ 		t2pWriteFile(output, (tdata_t) "/GS1 ", 5);
+-		buflen = sprintf(
+-			buffer, 
+-			"%lu", 
++		buflen = snprintf(buffer, sizeof(buffer), "%lu",
+ 			(unsigned long)(object + 3)); 
+ 		written += t2pWriteFile(output, (tdata_t) buffer, buflen);
+ 		written += t2pWriteFile(output, (tdata_t) " 0 R ", 5);
+@@ -4566,7 +4560,7 @@ tsize_t t2p_write_pdf_page_content_strea
+ 	if(t2p->tiff_tiles[t2p->pdf_page].tiles_tilecount>0){ 
+ 		for(i=0;i<t2p->tiff_tiles[t2p->pdf_page].tiles_tilecount; i++){
+ 			box=t2p->tiff_tiles[t2p->pdf_page].tiles_tiles[i].tile_box;
+-			buflen=sprintf(buffer, 
++			buflen=snprintf(buffer, sizeof(buffer),
+ 				"q %s %.4f %.4f %.4f %.4f %.4f %.4f cm /Im%d_%ld Do Q\n", 
+ 				t2p->tiff_transferfunctioncount?"/GS1 gs ":"",
+ 				box.mat[0],
+@@ -4581,7 +4575,7 @@ tsize_t t2p_write_pdf_page_content_strea
+ 		}
+ 	} else {
+ 		box=t2p->pdf_imagebox;
+-		buflen=sprintf(buffer, 
++		buflen=snprintf(buffer, sizeof(buffer),
+ 			"q %s %.4f %.4f %.4f %.4f %.4f %.4f cm /Im%d Do Q\n", 
+ 			t2p->tiff_transferfunctioncount?"/GS1 gs ":"",
+ 			box.mat[0],
+@@ -4606,59 +4600,48 @@ tsize_t t2p_write_pdf_xobject_stream_dic
+ 												TIFF* output){
+ 
+ 	tsize_t written=0;
+-	char buffer[16];
++	char buffer[32];
+ 	int buflen=0;
+ 
+ 	written += t2p_write_pdf_stream_dict(0, t2p->pdf_xrefcount+1, output); 
+ 	written += t2pWriteFile(output, 
+ 		(tdata_t) "/Type /XObject \n/Subtype /Image \n/Name /Im", 
+ 		42);
+-	buflen=sprintf(buffer, "%u", t2p->pdf_page+1);
++	buflen=snprintf(buffer, sizeof(buffer), "%u", t2p->pdf_page+1);
+ 	written += t2pWriteFile(output, (tdata_t) buffer, buflen);
+ 	if(tile != 0){
+ 		written += t2pWriteFile(output, (tdata_t) "_", 1);
+-		buflen=sprintf(buffer, "%lu", (unsigned long)tile);
++		buflen=snprintf(buffer, sizeof(buffer), "%lu", (unsigned long)tile);
+ 		written += t2pWriteFile(output, (tdata_t) buffer, buflen);
+ 	}
+ 	written += t2pWriteFile(output, (tdata_t) "\n/Width ", 8);
+-	_TIFFmemset((tdata_t)buffer, 0x00, 16);
+ 	if(tile==0){
+-		buflen=sprintf(buffer, "%lu", (unsigned long)t2p->tiff_width);
++		buflen=snprintf(buffer, sizeof(buffer), "%lu", (unsigned long)t2p->tiff_width);
+ 	} else {
+ 		if(t2p_tile_is_right_edge(t2p->tiff_tiles[t2p->pdf_page], tile-1)!=0){
+-			buflen=sprintf(
+-				buffer, 
+-				"%lu", 
++				buflen=snprintf(buffer, sizeof(buffer), "%lu",
+ 				(unsigned long)t2p->tiff_tiles[t2p->pdf_page].tiles_edgetilewidth);
+ 		} else {
+-			buflen=sprintf(
+-				buffer, 
+-				"%lu", 
++				buflen=snprintf(buffer, sizeof(buffer), "%lu",
+ 				(unsigned long)t2p->tiff_tiles[t2p->pdf_page].tiles_tilewidth);
+ 		}
+ 	}
+ 	written += t2pWriteFile(output, (tdata_t) buffer, buflen);
+ 	written += t2pWriteFile(output, (tdata_t) "\n/Height ", 9);
+-	_TIFFmemset((tdata_t)buffer, 0x00, 16);
+ 	if(tile==0){
+-		buflen=sprintf(buffer, "%lu", (unsigned long)t2p->tiff_length);
++		buflen=snprintf(buffer, sizeof(buffer), "%lu", (unsigned long)t2p->tiff_length);
+ 	} else {
+ 		if(t2p_tile_is_bottom_edge(t2p->tiff_tiles[t2p->pdf_page], tile-1)!=0){
+-			buflen=sprintf(
+-				buffer, 
+-				"%lu", 
++				buflen=snprintf(buffer, sizeof(buffer), "%lu",
+ 				(unsigned long)t2p->tiff_tiles[t2p->pdf_page].tiles_edgetilelength);
+ 		} else {
+-			buflen=sprintf(
+-				buffer, 
+-				"%lu", 
++				buflen=snprintf(buffer, sizeof(buffer), "%lu",
+ 				(unsigned long)t2p->tiff_tiles[t2p->pdf_page].tiles_tilelength);
+ 		}
+ 	}
+ 	written += t2pWriteFile(output, (tdata_t) buffer, buflen);
+ 	written += t2pWriteFile(output, (tdata_t) "\n/BitsPerComponent ", 19);
+-	_TIFFmemset((tdata_t)buffer, 0x00, 16);
+-	buflen=sprintf(buffer, "%u", t2p->tiff_bitspersample);
++	buflen=snprintf(buffer, sizeof(buffer), "%u", t2p->tiff_bitspersample);
+ 	written += t2pWriteFile(output, (tdata_t) buffer, buflen);
+ 	written += t2pWriteFile(output, (tdata_t) "\n/ColorSpace ", 13);
+ 	written += t2p_write_pdf_xobject_cs(t2p, output);
+@@ -4702,11 +4685,10 @@ tsize_t t2p_write_pdf_xobject_cs(T2P* t2
+ 		t2p->pdf_colorspace ^= T2P_CS_PALETTE;
+ 		written += t2p_write_pdf_xobject_cs(t2p, output);
+ 		t2p->pdf_colorspace |= T2P_CS_PALETTE;
+-		buflen=sprintf(buffer, "%u", (0x0001 << t2p->tiff_bitspersample)-1 );
++		buflen=snprintf(buffer, sizeof(buffer), "%u", (0x0001 << t2p->tiff_bitspersample)-1 );
+ 		written += t2pWriteFile(output, (tdata_t) buffer, buflen);
+ 		written += t2pWriteFile(output, (tdata_t) " ", 1);
+-		_TIFFmemset(buffer, 0x00, 16);
+-		buflen=sprintf(buffer, "%lu", (unsigned long)t2p->pdf_palettecs ); 
++		buflen=snprintf(buffer, sizeof(buffer), "%lu", (unsigned long)t2p->pdf_palettecs );
+ 		written += t2pWriteFile(output, (tdata_t) buffer, buflen);
+ 		written += t2pWriteFile(output, (tdata_t) " 0 R ]\n", 7);
+ 		return(written);
+@@ -4740,10 +4722,10 @@ tsize_t t2p_write_pdf_xobject_cs(T2P* t2
+ 			X_W /= Y_W;
+ 			Z_W /= Y_W;
+ 			Y_W = 1.0F;
+-			buflen=sprintf(buffer, "[%.4f %.4f %.4f] \n", X_W, Y_W, Z_W);
++			buflen=snprintf(buffer, sizeof(buffer), "[%.4f %.4f %.4f] \n", X_W, Y_W, Z_W);
+ 			written += t2pWriteFile(output, (tdata_t) buffer, buflen);
+ 			written += t2pWriteFile(output, (tdata_t) "/Range ", 7);
+-			buflen=sprintf(buffer, "[%d %d %d %d] \n", 
++			buflen=snprintf(buffer, sizeof(buffer), "[%d %d %d %d] \n",
+ 				t2p->pdf_labrange[0], 
+ 				t2p->pdf_labrange[1], 
+ 				t2p->pdf_labrange[2], 
+@@ -4759,26 +4741,26 @@ tsize_t t2p_write_pdf_xobject_cs(T2P* t2
+ tsize_t t2p_write_pdf_transfer(T2P* t2p, TIFF* output){
+ 
+ 	tsize_t written=0;
+-	char buffer[16];
++	char buffer[32];
+ 	int buflen=0;
+ 
+ 	written += t2pWriteFile(output, (tdata_t) "<< /Type /ExtGState \n/TR ", 25);
+ 	if(t2p->tiff_transferfunctioncount == 1){
+-		buflen=sprintf(buffer, "%lu",
++		buflen=snprintf(buffer, sizeof(buffer), "%lu",
+ 			       (unsigned long)(t2p->pdf_xrefcount + 1));
+ 		written += t2pWriteFile(output, (tdata_t) buffer, buflen);
+ 		written += t2pWriteFile(output, (tdata_t) " 0 R ", 5);
+ 	} else {
+ 		written += t2pWriteFile(output, (tdata_t) "[ ", 2);
+-		buflen=sprintf(buffer, "%lu",
++		buflen=snprintf(buffer, sizeof(buffer), "%lu",
+ 			       (unsigned long)(t2p->pdf_xrefcount + 1));
+ 		written += t2pWriteFile(output, (tdata_t) buffer, buflen);
+ 		written += t2pWriteFile(output, (tdata_t) " 0 R ", 5);
+-		buflen=sprintf(buffer, "%lu",
++		buflen=snprintf(buffer, sizeof(buffer), "%lu",
+ 			       (unsigned long)(t2p->pdf_xrefcount + 2));
+ 		written += t2pWriteFile(output, (tdata_t) buffer, buflen);
+ 		written += t2pWriteFile(output, (tdata_t) " 0 R ", 5);
+-		buflen=sprintf(buffer, "%lu",
++		buflen=snprintf(buffer, sizeof(buffer), "%lu",
+ 			       (unsigned long)(t2p->pdf_xrefcount + 3));
+ 		written += t2pWriteFile(output, (tdata_t) buffer, buflen);
+ 		written += t2pWriteFile(output, (tdata_t) " 0 R ", 5);
+@@ -4800,7 +4782,7 @@ tsize_t t2p_write_pdf_transfer_dict(T2P*
+ 	written += t2pWriteFile(output, (tdata_t) "/FunctionType 0 \n", 17);
+ 	written += t2pWriteFile(output, (tdata_t) "/Domain [0.0 1.0] \n", 19);
+ 	written += t2pWriteFile(output, (tdata_t) "/Range [0.0 1.0] \n", 18);
+-	buflen=sprintf(buffer, "/Size [%u] \n", (1<<t2p->tiff_bitspersample));
++	buflen=snprintf(buffer, sizeof(buffer), "/Size [%u] \n", (1<<t2p->tiff_bitspersample));
+ 	written += t2pWriteFile(output, (tdata_t) buffer, buflen);
+ 	written += t2pWriteFile(output, (tdata_t) "/BitsPerSample 16 \n", 19);
+ 	written += t2p_write_pdf_stream_dict(((tsize_t)1)<<(t2p->tiff_bitspersample+1), 0, output);
+@@ -4827,7 +4809,7 @@ tsize_t t2p_write_pdf_transfer_stream(T2
+ tsize_t t2p_write_pdf_xobject_calcs(T2P* t2p, TIFF* output){
+ 
+ 	tsize_t written=0;
+-	char buffer[128];
++	char buffer[256];
+ 	int buflen=0;
+ 	
+ 	float X_W=0.0;
+@@ -4895,16 +4877,16 @@ tsize_t t2p_write_pdf_xobject_calcs(T2P*
+ 	written += t2pWriteFile(output, (tdata_t) "<< \n", 4);
+ 	if(t2p->pdf_colorspace & T2P_CS_CALGRAY){
+ 		written += t2pWriteFile(output, (tdata_t) "/WhitePoint ", 12);
+-		buflen=sprintf(buffer, "[%.4f %.4f %.4f] \n", X_W, Y_W, Z_W);
++		buflen=snprintf(buffer, sizeof(buffer), "[%.4f %.4f %.4f] \n", X_W, Y_W, Z_W);
+ 		written += t2pWriteFile(output, (tdata_t) buffer, buflen);
+ 		written += t2pWriteFile(output, (tdata_t) "/Gamma 2.2 \n", 12);
+ 	}
+ 	if(t2p->pdf_colorspace & T2P_CS_CALRGB){
+ 		written += t2pWriteFile(output, (tdata_t) "/WhitePoint ", 12);
+-		buflen=sprintf(buffer, "[%.4f %.4f %.4f] \n", X_W, Y_W, Z_W);
++		buflen=snprintf(buffer, sizeof(buffer), "[%.4f %.4f %.4f] \n", X_W, Y_W, Z_W);
+ 		written += t2pWriteFile(output, (tdata_t) buffer, buflen);
+ 		written += t2pWriteFile(output, (tdata_t) "/Matrix ", 8);
+-		buflen=sprintf(buffer, "[%.4f %.4f %.4f %.4f %.4f %.4f %.4f %.4f %.4f] \n", 
++		buflen=snprintf(buffer, sizeof(buffer), "[%.4f %.4f %.4f %.4f %.4f %.4f %.4f %.4f %.4f] \n",
+ 			X_R, Y_R, Z_R, 
+ 			X_G, Y_G, Z_G, 
+ 			X_B, Y_B, Z_B); 
+@@ -4923,11 +4905,11 @@ tsize_t t2p_write_pdf_xobject_calcs(T2P*
+ tsize_t t2p_write_pdf_xobject_icccs(T2P* t2p, TIFF* output){
+ 
+ 	tsize_t written=0;
+-	char buffer[16];
++	char buffer[32];
+ 	int buflen=0;
+ 	
+ 	written += t2pWriteFile(output, (tdata_t) "[/ICCBased ", 11);
+-	buflen=sprintf(buffer, "%lu", (unsigned long)t2p->pdf_icccs);
++	buflen=snprintf(buffer, sizeof(buffer), "%lu", (unsigned long)t2p->pdf_icccs);
+ 	written += t2pWriteFile(output, (tdata_t) buffer, buflen);
+ 	written += t2pWriteFile(output, (tdata_t) " 0 R] \n", 7);
+ 
+@@ -4937,11 +4919,11 @@ tsize_t t2p_write_pdf_xobject_icccs(T2P*
+ tsize_t t2p_write_pdf_xobject_icccs_dict(T2P* t2p, TIFF* output){
+ 
+ 	tsize_t written=0;
+-	char buffer[16];
++	char buffer[32];
+ 	int buflen=0;
+ 	
+ 	written += t2pWriteFile(output, (tdata_t) "/N ", 3);
+-	buflen=sprintf(buffer, "%u \n", t2p->tiff_samplesperpixel);
++	buflen=snprintf(buffer, sizeof(buffer), "%u \n", t2p->tiff_samplesperpixel);
+ 	written += t2pWriteFile(output, (tdata_t) buffer, buflen);
+ 	written += t2pWriteFile(output, (tdata_t) "/Alternate ", 11);
+ 	t2p->pdf_colorspace ^= T2P_CS_ICCBASED;
+@@ -5006,7 +4988,7 @@ tsize_t t2p_write_pdf_xobject_decode(T2P
+ tsize_t t2p_write_pdf_xobject_stream_filter(ttile_t tile, T2P* t2p, TIFF* output){
+ 
+ 	tsize_t written=0;
+-	char buffer[16];
++	char buffer[32];
+ 	int buflen=0;
+ 
+ 	if(t2p->pdf_compression==T2P_COMPRESS_NONE){
+@@ -5021,41 +5003,33 @@ tsize_t t2p_write_pdf_xobject_stream_fil
+ 			written += t2pWriteFile(output, (tdata_t) "<< /K -1 ", 9);
+ 			if(tile==0){
+ 				written += t2pWriteFile(output, (tdata_t) "/Columns ", 9);
+-				buflen=sprintf(buffer, "%lu",
++				buflen=snprintf(buffer, sizeof(buffer), "%lu",
+ 					       (unsigned long)t2p->tiff_width);
+ 				written += t2pWriteFile(output, (tdata_t) buffer, buflen);
+ 				written += t2pWriteFile(output, (tdata_t) " /Rows ", 7);
+-				buflen=sprintf(buffer, "%lu",
++				buflen=snprintf(buffer, sizeof(buffer), "%lu",
+ 					       (unsigned long)t2p->tiff_length);
+ 				written += t2pWriteFile(output, (tdata_t) buffer, buflen);
+ 			} else {
+ 				if(t2p_tile_is_right_edge(t2p->tiff_tiles[t2p->pdf_page], tile-1)==0){
+ 					written += t2pWriteFile(output, (tdata_t) "/Columns ", 9);
+-					buflen=sprintf(
+-						buffer, 
+-						"%lu", 
++					buflen=snprintf(buffer, sizeof(buffer), "%lu",
+ 						(unsigned long)t2p->tiff_tiles[t2p->pdf_page].tiles_tilewidth);
+ 					written += t2pWriteFile(output, (tdata_t) buffer, buflen);
+ 				} else {
+ 					written += t2pWriteFile(output, (tdata_t) "/Columns ", 9);
+-					buflen=sprintf(
+-						buffer, 
+-						"%lu", 
++					buflen=snprintf(buffer, sizeof(buffer), "%lu",
+ 						(unsigned long)t2p->tiff_tiles[t2p->pdf_page].tiles_edgetilewidth);
+ 					written += t2pWriteFile(output, (tdata_t) buffer, buflen);
+ 				}
+ 				if(t2p_tile_is_bottom_edge(t2p->tiff_tiles[t2p->pdf_page], tile-1)==0){
+ 					written += t2pWriteFile(output, (tdata_t) " /Rows ", 7);
+-					buflen=sprintf(
+-						buffer, 
+-						"%lu", 
++					buflen=snprintf(buffer, sizeof(buffer), "%lu",
+ 						(unsigned long)t2p->tiff_tiles[t2p->pdf_page].tiles_tilelength);
+ 					written += t2pWriteFile(output, (tdata_t) buffer, buflen);
+ 				} else {
+ 					written += t2pWriteFile(output, (tdata_t) " /Rows ", 7);
+-					buflen=sprintf(
+-						buffer, 
+-						"%lu", 
++					buflen=snprintf(buffer, sizeof(buffer), "%lu",
+ 						(unsigned long)t2p->tiff_tiles[t2p->pdf_page].tiles_edgetilelength);
+ 					written += t2pWriteFile(output, (tdata_t) buffer, buflen);
+ 				}
+@@ -5083,20 +5057,17 @@ tsize_t t2p_write_pdf_xobject_stream_fil
+ 				written += t2pWriteFile(output, (tdata_t) "/DecodeParms ", 13);
+ 				written += t2pWriteFile(output, (tdata_t) "<< /Predictor ", 14);
+ 				_TIFFmemset(buffer, 0x00, 16);
+-				buflen=sprintf(buffer, "%u", t2p->pdf_compressionquality%100);
++				buflen=snprintf(buffer, sizeof(buffer), "%u", t2p->pdf_compressionquality%100);
+ 				written += t2pWriteFile(output, (tdata_t) buffer, buflen);
+ 				written += t2pWriteFile(output, (tdata_t) " /Columns ", 10);
+-				_TIFFmemset(buffer, 0x00, 16);
+-				buflen = sprintf(buffer, "%lu",
++				buflen = snprintf(buffer, sizeof(buffer), "%lu",
+ 						 (unsigned long)t2p->tiff_width);
+ 				written += t2pWriteFile(output, (tdata_t) buffer, buflen);
+ 				written += t2pWriteFile(output, (tdata_t) " /Colors ", 9);
+-				_TIFFmemset(buffer, 0x00, 16);
+-				buflen=sprintf(buffer, "%u", t2p->tiff_samplesperpixel);
++				buflen=snprintf(buffer, sizeof(buffer), "%u", t2p->tiff_samplesperpixel);
+ 				written += t2pWriteFile(output, (tdata_t) buffer, buflen);
+ 				written += t2pWriteFile(output, (tdata_t) " /BitsPerComponent ", 19);
+-				_TIFFmemset(buffer, 0x00, 16);
+-				buflen=sprintf(buffer, "%u", t2p->tiff_bitspersample);
++				buflen=snprintf(buffer, sizeof(buffer), "%u", t2p->tiff_bitspersample);
+ 				written += t2pWriteFile(output, (tdata_t) buffer, buflen);
+ 				written += t2pWriteFile(output, (tdata_t) ">>\n", 3);
+ 			}
+@@ -5116,16 +5087,16 @@ tsize_t t2p_write_pdf_xobject_stream_fil
+ tsize_t t2p_write_pdf_xreftable(T2P* t2p, TIFF* output){
+ 
+ 	tsize_t written=0;
+-	char buffer[21];
++	char buffer[64];
+ 	int buflen=0;
+ 	uint32 i=0;
+ 
+ 	written += t2pWriteFile(output, (tdata_t) "xref\n0 ", 7);
+-	buflen=sprintf(buffer, "%lu", (unsigned long)(t2p->pdf_xrefcount + 1));
++	buflen=snprintf(buffer, sizeof(buffer), "%lu", (unsigned long)(t2p->pdf_xrefcount + 1));
+ 	written += t2pWriteFile(output, (tdata_t) buffer, buflen);
+ 	written += t2pWriteFile(output, (tdata_t) " \n0000000000 65535 f \n", 22);
+ 	for (i=0;i<t2p->pdf_xrefcount;i++){
+-		sprintf(buffer, "%.10lu 00000 n \n",
++		snprintf(buffer, sizeof(buffer), "%.10lu 00000 n \n",
+ 			(unsigned long)t2p->pdf_xrefoffsets[i]);
+ 		written += t2pWriteFile(output, (tdata_t) buffer, 20);
+ 	}
+@@ -5149,17 +5120,14 @@ tsize_t t2p_write_pdf_trailer(T2P* t2p, 
+ 		snprintf(t2p->pdf_fileid + i, 9, "%.8X", rand());
+ 
+ 	written += t2pWriteFile(output, (tdata_t) "trailer\n<<\n/Size ", 17);
+-	buflen = sprintf(buffer, "%lu", (unsigned long)(t2p->pdf_xrefcount+1));
++	buflen = snprintf(buffer, sizeof(buffer), "%lu", (unsigned long)(t2p->pdf_xrefcount+1));
+ 	written += t2pWriteFile(output, (tdata_t) buffer, buflen);
+-	_TIFFmemset(buffer, 0x00, 32);	
+ 	written += t2pWriteFile(output, (tdata_t) "\n/Root ", 7);
+-	buflen=sprintf(buffer, "%lu", (unsigned long)t2p->pdf_catalog);
++	buflen=snprintf(buffer, sizeof(buffer), "%lu", (unsigned long)t2p->pdf_catalog);
+ 	written += t2pWriteFile(output, (tdata_t) buffer, buflen);
+-	_TIFFmemset(buffer, 0x00, 32);	
+ 	written += t2pWriteFile(output, (tdata_t) " 0 R \n/Info ", 12);
+-	buflen=sprintf(buffer, "%lu", (unsigned long)t2p->pdf_info);
++	buflen=snprintf(buffer, sizeof(buffer), "%lu", (unsigned long)t2p->pdf_info);
+ 	written += t2pWriteFile(output, (tdata_t) buffer, buflen);
+-	_TIFFmemset(buffer, 0x00, 32);	
+ 	written += t2pWriteFile(output, (tdata_t) " 0 R \n/ID[<", 11);
+ 	written += t2pWriteFile(output, (tdata_t) t2p->pdf_fileid,
+ 				sizeof(t2p->pdf_fileid) - 1);
+@@ -5167,9 +5135,8 @@ tsize_t t2p_write_pdf_trailer(T2P* t2p, 
+ 	written += t2pWriteFile(output, (tdata_t) t2p->pdf_fileid,
+ 				sizeof(t2p->pdf_fileid) - 1);
+ 	written += t2pWriteFile(output, (tdata_t) ">]\n>>\nstartxref\n", 16);
+-	buflen=sprintf(buffer, "%lu", (unsigned long)t2p->pdf_startxref);
++	buflen=snprintf(buffer, sizeof(buffer), "%lu", (unsigned long)t2p->pdf_startxref);
+ 	written += t2pWriteFile(output, (tdata_t) buffer, buflen);
+-	_TIFFmemset(buffer, 0x00, 32);	
+ 	written += t2pWriteFile(output, (tdata_t) "\n%%EOF\n", 7);
+ 
+ 	return(written);
+--- tiff-4.0.3/tools/tiff2ps.c.orig	2013-06-06 16:41:42.291338316 +0530
++++ tiff-4.0.3/tools/tiff2ps.c	2013-06-06 16:44:40.624788826 +0530
+@@ -1781,8 +1781,8 @@ PS_Lvl2ImageDict(FILE* fd, TIFF* tif, ui
+ 		imageOp = "imagemask";
+ 
+ 	(void)strcpy(im_x, "0");
+-	(void)sprintf(im_y, "%lu", (long) h);
+-	(void)sprintf(im_h, "%lu", (long) h);
++	(void)snprintf(im_y, sizeof(im_y), "%lu", (long) h);
++	(void)snprintf(im_h, sizeof(im_h), "%lu", (long) h);
+ 	tile_width = w;
+ 	tile_height = h;
+ 	if (TIFFIsTiled(tif)) {
+@@ -1803,7 +1803,7 @@ PS_Lvl2ImageDict(FILE* fd, TIFF* tif, ui
+ 		}
+ 		if (tile_height < h) {
+ 			fputs("/im_y 0 def\n", fd);
+-			(void)sprintf(im_y, "%lu im_y sub", (unsigned long) h);
++			(void)snprintf(im_y, sizeof(im_y), "%lu im_y sub", (unsigned long) h);
+ 		}
+ 	} else {
+ 		repeat_count = tf_numberstrips;
+@@ -1815,7 +1815,7 @@ PS_Lvl2ImageDict(FILE* fd, TIFF* tif, ui
+ 			fprintf(fd, "/im_h %lu def\n",
+ 			    (unsigned long) tile_height);
+ 			(void)strcpy(im_h, "im_h");
+-			(void)sprintf(im_y, "%lu im_y sub", (unsigned long) h);
++			(void)snprintf(im_y, sizeof(im_y), "%lu im_y sub", (unsigned long) h);
+ 		}
+ 	}
+ 
+--- tiff-4.0.3/tools/tiffcrop.c.orig	2013-06-06 16:44:50.409648649 +0530
++++ tiff-4.0.3/tools/tiffcrop.c	2013-06-07 10:51:06.442397808 +0530
+@@ -2077,7 +2077,7 @@ update_output_file (TIFF **tiffout, char
+         return 1;
+         }
+ 
+-      sprintf (filenum, "-%03d%s", findex, export_ext);
++      snprintf(filenum, sizeof(filenum), "-%03d%s", findex, export_ext);
+       filenum[14] = '\0';
+       strncat (exportname, filenum, 15);
+       }
+@@ -2230,8 +2230,8 @@ main(int argc, char* argv[])
+ 
+           /* dump.infilename is guaranteed to be NUL termimated and have 20 bytes 
+              fewer than PATH_MAX */ 
+-          memset (temp_filename, '\0', PATH_MAX + 1);              
+-          sprintf (temp_filename, "%s-read-%03d.%s", dump.infilename, dump_images,
++	  snprintf(temp_filename, sizeof(temp_filename), "%s-write-%03d.%s",
++		  dump.outfilename, dump_images,
+                   (dump.format == DUMP_TEXT) ? "txt" : "raw");
+           if ((dump.infile = fopen(temp_filename, dump.mode)) == NULL)
+             {
+@@ -2249,8 +2249,8 @@ main(int argc, char* argv[])
+ 
+           /* dump.outfilename is guaranteed to be NUL termimated and have 20 bytes 
+              fewer than PATH_MAX */ 
+-          memset (temp_filename, '\0', PATH_MAX + 1);              
+-          sprintf (temp_filename, "%s-write-%03d.%s", dump.outfilename, dump_images,
++          snprintf(temp_filename, sizeof(temp_filename), "%s-write-%03d.%s",
++                  dump.outfilename, dump_images,
+                   (dump.format == DUMP_TEXT) ? "txt" : "raw");
+           if ((dump.outfile = fopen(temp_filename, dump.mode)) == NULL)
+             {
+--- tiff-4.0.3/tools/tiffdither.c.orig	2013-06-06 16:46:31.684236097 +0530
++++ tiff-4.0.3/tools/tiffdither.c	2013-06-06 16:46:56.138760820 +0530
+@@ -260,7 +260,7 @@ main(int argc, char* argv[])
+ 		TIFFSetField(out, TIFFTAG_FILLORDER, fillorder);
+ 	else
+ 		CopyField(TIFFTAG_FILLORDER, shortv);
+-	sprintf(thing, "Dithered B&W version of %s", argv[optind]);
++	snprintf(thing, sizeof(thing), "Dithered B&W version of %s", argv[optind]);
+ 	TIFFSetField(out, TIFFTAG_IMAGEDESCRIPTION, thing);
+ 	CopyField(TIFFTAG_PHOTOMETRIC, shortv);
+ 	CopyField(TIFFTAG_ORIENTATION, shortv);
+--- tiff-4.0.3/tools/rgb2ycbcr.c.orig	2013-06-21 10:32:40.150900762 +0530
++++ tiff-4.0.3/tools/rgb2ycbcr.c	2013-06-21 10:33:45.287429208 +0530
+@@ -332,7 +332,7 @@ tiffcvt(TIFF* in, TIFF* out)
+ 	TIFFSetField(out, TIFFTAG_PLANARCONFIG, PLANARCONFIG_CONTIG);
+ 	{ char buf[2048];
+ 	  char *cp = strrchr(TIFFFileName(in), '/');
+-	  sprintf(buf, "YCbCr conversion of %s", cp ? cp+1 : TIFFFileName(in));
++	  snprintf(buf, sizeof(buf), "YCbCr conversion of %s", cp ? cp+1 : TIFFFileName(in));
+ 	  TIFFSetField(out, TIFFTAG_IMAGEDESCRIPTION, buf);
+ 	}
+ 	TIFFSetField(out, TIFFTAG_SOFTWARE, TIFFGetVersion());
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/desktop/libtiff/patches/tiff-02-CVE-2013-1960.patch	Thu Mar 17 08:44:16 2016 -0700
@@ -0,0 +1,146 @@
+We should be able to remove this patch once we update to the most recent version of libtiff
+
+--- tiff-4.0.3/tools/tiff2pdf.c.orig	2013-06-21 10:49:54.753178402 +0530
++++ tiff-4.0.3/tools/tiff2pdf.c	2013-06-21 11:06:30.022406791 +0530
+@@ -3341,33 +3341,56 @@ int t2p_process_jpeg_strip(
+ 	uint32 height){
+ 
+ 	tsize_t i=0;
+-	uint16 ri =0;
+-	uint16 v_samp=1;
+-	uint16 h_samp=1;
+-	int j=0;
+-	
+-	i++;
+-	
+-	while(i<(*striplength)){
++
++	while (i < *striplength) {
++		tsize_t datalen;
++		uint16 ri;
++		uint16 v_samp;
++		uint16 h_samp;
++		int j;
++		int ncomp;
++
++		/* marker header: one or more FFs */
++		if (strip[i] != 0xff)
++		return(0);
++		i++;
++		while (i < *striplength && strip[i] == 0xff)
++		i++;
++		if (i >= *striplength)
++		return(0);
++		/* SOI is the only pre-SOS marker without a length word */
++		if (strip[i] == 0xd8)
++		datalen = 0;
++		else {
++			if ((*striplength - i) <= 2)
++				return(0);
++			datalen = (strip[i+1] << 8) | strip[i+2];
++			if (datalen < 2 || datalen >= (*striplength - i))
++				return(0);
++		}
+ 		switch( strip[i] ){
+-			case 0xd8:
+-				/* SOI - start of image */
++			case 0xd8:	/* SOI - start of image */
+ 				_TIFFmemcpy(&(buffer[*bufferoffset]), &(strip[i-1]), 2);
+ 				*bufferoffset+=2;
+-				i+=2;
+ 				break;
+-			case 0xc0:
+-			case 0xc1:
+-			case 0xc3:
+-			case 0xc9:
+-			case 0xca:
++			case 0xc0: /* SOF0 */
++			case 0xc1: /* SOF1 */
++			case 0xc3: /* SOF3 */
++			case 0xc9: /* SOF9 */
++			case 0xca: /* SOF10 */
+ 				if(no==0){
+-					_TIFFmemcpy(&(buffer[*bufferoffset]), &(strip[i-1]), strip[i+2]+2);
+-					for(j=0;j<buffer[*bufferoffset+9];j++){
+-						if( (buffer[*bufferoffset+11+(2*j)]>>4) > h_samp) 
+-							h_samp = (buffer[*bufferoffset+11+(2*j)]>>4);
+-						if( (buffer[*bufferoffset+11+(2*j)] & 0x0f) > v_samp) 
+-							v_samp = (buffer[*bufferoffset+11+(2*j)] & 0x0f);
++					_TIFFmemcpy(&(buffer[*bufferoffset]), &(strip[i-1]), datalen+2);
++					ncomp = buffer[*bufferoffset+9];
++					if (ncomp < 1 || ncomp > 4)
++						return(0);
++					v_samp=1;
++					h_samp=1;
++					for(j=0;j<ncomp;j++){
++						uint16 samp = buffer[*bufferoffset+11+(3*j)];
++						if( (samp>>4) > h_samp)
++							h_samp = (samp>>4);
++						if( (samp & 0x0f) > v_samp)
++							v_samp = (samp & 0x0f);
+ 					}
+ 					v_samp*=8;
+ 					h_samp*=8;
+@@ -3381,45 +3404,44 @@ int t2p_process_jpeg_strip(
+                                           (unsigned char) ((height>>8) & 0xff);
+ 					buffer[*bufferoffset+6]=
+                                             (unsigned char) (height & 0xff);
+-					*bufferoffset+=strip[i+2]+2;
+-					i+=strip[i+2]+2;
+ 
++					*bufferoffset+=datalen+2;
++					/* insert a DRI marker */
+ 					buffer[(*bufferoffset)++]=0xff;
+ 					buffer[(*bufferoffset)++]=0xdd;
+ 					buffer[(*bufferoffset)++]=0x00;
+ 					buffer[(*bufferoffset)++]=0x04;
+ 					buffer[(*bufferoffset)++]=(ri >> 8) & 0xff;
+ 					buffer[(*bufferoffset)++]= ri & 0xff;
+-				} else {
+-					i+=strip[i+2]+2;
+ 				}
+ 				break;
+-			case 0xc4:
+-			case 0xdb:
+-				_TIFFmemcpy(&(buffer[*bufferoffset]), &(strip[i-1]), strip[i+2]+2);
+-				*bufferoffset+=strip[i+2]+2;
+-				i+=strip[i+2]+2;
++			case 0xc4: /* DHT */
++			case 0xdb: /* DQT */
++				_TIFFmemcpy(&(buffer[*bufferoffset]), &(strip[i-1]), datalen+2);
++				*bufferoffset+=datalen+2;
+ 				break;
+-			case 0xda:
++			case 0xda: /* SOS */
+ 				if(no==0){
+-					_TIFFmemcpy(&(buffer[*bufferoffset]), &(strip[i-1]), strip[i+2]+2);
+-					*bufferoffset+=strip[i+2]+2;
+-					i+=strip[i+2]+2;
++					_TIFFmemcpy(&(buffer[*bufferoffset]), &(strip[i-1]), datalen+2);
++					*bufferoffset+=datalen+2;
+ 				} else {
+ 					buffer[(*bufferoffset)++]=0xff;
+ 					buffer[(*bufferoffset)++]=
+                                             (unsigned char)(0xd0 | ((no-1)%8));
+-					i+=strip[i+2]+2;
+ 				}
+-				_TIFFmemcpy(&(buffer[*bufferoffset]), &(strip[i-1]), (*striplength)-i-1);
+-				*bufferoffset+=(*striplength)-i-1;
++				i += datalen + 1;
++				/* copy remainder of strip */
++				_TIFFmemcpy(&(buffer[*bufferoffset]), &(strip[i]), *striplength - i);
++				*bufferoffset+= *striplength - i;
+ 				return(1);
+ 			default:
+-				i+=strip[i+2]+2;
++				/* ignore any other marker */
++				break;
+ 		}
++		i += datalen + 1;
+ 	}
+ 	
+-
++	/* failed to find SOS marker */
+ 	return(0);
+ }
+ #endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/desktop/libtiff/patches/tiff-03-CVE-2012-4564.patch	Thu Mar 17 08:44:16 2016 -0700
@@ -0,0 +1,32 @@
+We should be able to remove this patch once we update to the most recent version
+
+--- tiff-4.0.3/tools/ppm2tiff.c.orig	2013-06-21 14:38:02.695130336 +0530
++++ tiff-4.0.3/tools/ppm2tiff.c	2013-06-21 14:44:53.338661655 +0530
+@@ -89,6 +89,7 @@ main(int argc, char* argv[])
+ 	int c;
+ 	extern int optind;
+ 	extern char* optarg;
++	tmsize_t scanline_size;
+ 
+ 	if (argc < 2) {
+ 	    fprintf(stderr, "%s: Too few arguments\n", argv[0]);
+@@ -237,8 +238,17 @@ main(int argc, char* argv[])
+ 	}
+ 	if (TIFFScanlineSize(out) > linebytes)
+ 		buf = (unsigned char *)_TIFFmalloc(linebytes);
+-	else
+-		buf = (unsigned char *)_TIFFmalloc(TIFFScanlineSize(out));
++	else {
++		scanline_size = TIFFScanlineSize(out);
++		if (scanline_size != 0)
++			buf = (unsigned char *)_TIFFmalloc(TIFFScanlineSize(out));
++		else {
++			fprintf(stderr, "%s: scanline size overflow\n",infile);
++			(void) TIFFClose(out);
++			exit(-2);					
++			}
++	}
++
+ 	if (resolution > 0) {
+ 		TIFFSetField(out, TIFFTAG_XRESOLUTION, resolution);
+ 		TIFFSetField(out, TIFFTAG_YRESOLUTION, resolution);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/desktop/libtiff/patches/tiff-04-CVE-2013-4231.patch	Thu Mar 17 08:44:16 2016 -0700
@@ -0,0 +1,15 @@
+We should be able to remove this patch once we update to the most recent version
+
+--- tiff-4.0.3/tools/gif2tiff.c.orig	2013-10-03 17:56:46.235440506 +0530
++++ tiff-4.0.3/tools/gif2tiff.c	2013-10-03 17:59:06.519917771 +0530
+@@ -333,6 +333,10 @@ readraster(void)
+     int status = 1;
+ 
+     datasize = getc(infile);
++
++    if (datasize > 12)
++	return 0;
++
+     clear = 1 << datasize;
+     eoi = clear + 1;
+     avail = clear + 2;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/desktop/libtiff/patches/tiff-05-CVE-2013-4232.patch	Thu Mar 17 08:44:16 2016 -0700
@@ -0,0 +1,12 @@
+We should be able to remove this patch once we update to the most recent version
+
+--- tiff-4.0.3/tools/tiff2pdf.c.orig	2013-10-03 18:14:06.789911741 +0530
++++ tiff-4.0.3/tools/tiff2pdf.c	2013-10-03 18:14:48.881676646 +0530
+@@ -2462,6 +2462,7 @@ tsize_t t2p_readwrite_pdf_image(T2P* t2p
+ 					TIFFFileName(input));
+ 				t2p->t2p_error = T2P_ERR_ERROR;
+ 			  _TIFFfree(buffer);
++			  return(0);
+ 			} else {
+ 				buffer=samplebuffer;
+ 				t2p->tiff_datasize *= t2p->tiff_samplesperpixel;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/desktop/libtiff/patches/tiff-06-CVE-2013-4243-CVE-2013-4244.patch	Thu Mar 17 08:44:16 2016 -0700
@@ -0,0 +1,42 @@
+We should be able to remove this patch once we update to the most recent version
+
+--- tiff-4.0.3/tools/gif2tiff.c.orig	2014-03-11 12:18:07.600064125 +0530
++++ tiff-4.0.3/tools/gif2tiff.c	2014-03-12 11:55:42.019606928 +0530
+@@ -280,6 +280,10 @@ readgifimage(char* mode)
+         fprintf(stderr, "no colormap present for image\n");
+         return (0);
+     }
++    if (width == 0 || height == 0) {
++      fprintf(stderr, "Invalid value of width or height\n");
++      return(0);
++    }
+     if ((raster = (unsigned char*) _TIFFmalloc(width*height+EXTRAFUDGE)) == NULL) {
+         fprintf(stderr, "not enough memory for image\n");
+         return (0);
+@@ -401,7 +405,15 @@ process(register int code, unsigned char
+ 	return 1;
+     }
+ 
++    if (*fill >= raster + width*height) {
++    	fprintf(stderr, "raster full before eoi code\n");
++    	return 0;
++    }
+     if (oldcode == -1) {
++	if (code >= clear) {
++		fprintf(stderr, "bad input: code=%d is larger than clear=%d\n",code, clear);
++		return 0;
++	}
+ 	*(*fill)++ = suffix[code];
+ 	firstchar = oldcode = code;
+ 	return 1;
+@@ -432,6 +444,10 @@ process(register int code, unsigned char
+     }
+     oldcode = incode;
+     do {
++        if (*fill >= raster + width*height) {
++           fprintf(stderr, "raster full before eoi code\n");
++           return 0;
++        }
+ 	*(*fill)++ = *--stackp;
+     } while (stackp > stack);
+     return 1;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/desktop/libtiff/patches/tiff-07-CVE-2015-1547-CVE-2014-9655.patch	Thu Mar 17 08:44:16 2016 -0700
@@ -0,0 +1,95 @@
+We should be able to remove this patch once we update to the most recent version
+
+--- tiff-4.0.3/libtiff/tif_getimage.c.orig	2015-04-24 11:10:22.706359602 +0530
++++ tiff-4.0.3/libtiff/tif_getimage.c	2015-04-24 14:15:36.081143460 +0530
+@@ -842,6 +842,12 @@ gtStripContig(TIFFRGBAImage* img, uint32
+ 	int32 fromskew, toskew;
+ 	int ret = 1, flip;
+ 
++	TIFFGetFieldDefaulted(tif, TIFFTAG_YCBCRSUBSAMPLING, &subsamplinghor, &subsamplingver);
++	if( subsamplingver == 0 ) {
++		TIFFErrorExt(tif->tif_clientdata, TIFFFileName(tif), "Invalid vertical YCbCr subsampling");
++		return (0);
++	}
++
+ 	buf = (unsigned char*) _TIFFmalloc(TIFFStripSize(tif));
+ 	if (buf == 0) {
+ 		TIFFErrorExt(tif->tif_clientdata, TIFFFileName(tif), "No space for strip buffer");
+@@ -859,7 +865,7 @@ gtStripContig(TIFFRGBAImage* img, uint32
+ 	}
+ 
+ 	TIFFGetFieldDefaulted(tif, TIFFTAG_ROWSPERSTRIP, &rowsperstrip);
+-	TIFFGetFieldDefaulted(tif, TIFFTAG_YCBCRSUBSAMPLING, &subsamplinghor, &subsamplingver);
++
+ 	scanline = TIFFScanlineSize(tif);
+ 	fromskew = (w < imagewidth ? imagewidth - w : 0);
+ 	for (row = 0; row < h; row += nrow)
+@@ -1852,7 +1858,7 @@ DECLAREContigPutFunc(putcontig8bitYCbCr4
+ 
+     (void) y;
+     fromskew = (fromskew * 10) / 4;
+-    if ((h & 3) == 0 && (w & 1) == 0) {
++    if ((w & 3) == 0 && (h & 1) == 0) {
+         for (; h >= 2; h -= 2) {
+             x = w>>2;
+             do {
+@@ -1929,7 +1935,7 @@ DECLAREContigPutFunc(putcontig8bitYCbCr4
+     /* XXX adjust fromskew */
+     do {
+ 	x = w>>2;
+-	do {
++        while(x>0) {
+ 	    int32 Cb = pp[4];
+ 	    int32 Cr = pp[5];
+ 
+@@ -1940,8 +1946,8 @@ DECLAREContigPutFunc(putcontig8bitYCbCr4
+ 
+ 	    cp += 4;
+ 	    pp += 6;
+-	} while (--x);
+-
++	    x--;
++	}
+         if( (w&3) != 0 )
+         {
+ 	    int32 Cb = pp[4];
+@@ -2031,7 +2037,7 @@ DECLAREContigPutFunc(putcontig8bitYCbCr2
+ 	fromskew = (fromskew * 4) / 2;
+ 	do {
+ 		x = w>>1;
+-		do {
++		while(x>0) {
+ 			int32 Cb = pp[2];
+ 			int32 Cr = pp[3];
+ 
+@@ -2040,8 +2046,8 @@ DECLAREContigPutFunc(putcontig8bitYCbCr2
+ 
+ 			cp += 2;
+ 			pp += 4;
+-		} while (--x);
+-
++			x --;
++		}
+ 		if( (w&1) != 0 )
+ 		{
+ 			int32 Cb = pp[2];
+--- tiff-4.0.3/libtiff/tif_next.c.orig	2015-04-24 11:17:36.709603113 +0530
++++ tiff-4.0.3/libtiff/tif_next.c	2015-04-24 11:27:38.802984065 +0530
+@@ -71,7 +71,7 @@ NeXTDecode(TIFF* tif, uint8* buf, tmsize
+ 		TIFFErrorExt(tif->tif_clientdata, module, "Fractional scanlines cannot be read");
+ 		return (0);
+ 	}
+-	for (row = buf; occ > 0; occ -= scanline, row += scanline) {
++	for (row = buf; cc > 0 && occ > 0; occ -= scanline, row += scanline) {
+ 		n = *bp++, cc--;
+ 		switch (n) {
+ 		case LITERALROW:
+@@ -90,6 +90,8 @@ NeXTDecode(TIFF* tif, uint8* buf, tmsize
+ 			 * The scanline has a literal span that begins at some
+ 			 * offset.
+ 			 */
++			if( cc < 4 )
++				goto bad;
+ 			off = (bp[0] * 256) + bp[1];
+ 			n = (bp[2] * 256) + bp[3];
+ 			if (cc < 4+n || off+n > scanline)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/desktop/libtiff/patches/tiff-08-CVE-2014-9330.patch	Thu Mar 17 08:44:16 2016 -0700
@@ -0,0 +1,32 @@
+We should be able to remove this patch once we update to the most recent version
+
+--- tiff-4.0.3/tools/bmp2tiff.c.orig	2015-06-15 11:24:23.849980166 +0530
++++ tiff-4.0.3/tools/bmp2tiff.c	2015-06-15 11:27:10.477947953 +0530
+@@ -403,7 +403,12 @@ main(int argc, char* argv[])
+ 
+ 		width = info_hdr.iWidth;
+ 		length = (info_hdr.iHeight > 0) ? info_hdr.iHeight : -info_hdr.iHeight;
+-
++		if( width <= 0 || length <= 0 )
++		{
++			TIFFError(infilename, "Invalid dimensions of BMP file" );
++			close(fd);
++			return -1;
++		}
+ 		switch (info_hdr.iBitCount)
+ 		{
+ 			case 1:
+@@ -593,6 +598,13 @@ main(int argc, char* argv[])
+ 
+ 			compr_size = file_hdr.iSize - file_hdr.iOffBits;
+ 			uncompr_size = width * length;
++			/* Detect int overflow */
++			if( uncompr_size / width != length )
++			{
++				TIFFError(infilename, "Invalid dimensions of BMP file" );
++				close(fd);
++				return -1;
++			}
+ 			comprbuf = (unsigned char *) _TIFFmalloc( compr_size );
+ 			if (!comprbuf) {
+ 				TIFFError(infilename,
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/desktop/libtiff/test/results-all.master	Thu Mar 17 08:44:16 2016 -0700
@@ -0,0 +1,88 @@
+PASS: ascii_tag
+PASS: long_tag
+PASS: short_tag
+PASS: strip_rw
+PASS: rewrite
+PASS: raw_decode
+PASS: custom_dir
+PASS: bmp2tiff_palette.sh
+PASS: bmp2tiff_rgb.sh
+PASS: gif2tiff.sh
+PASS: ppm2tiff_pbm.sh
+PASS: ppm2tiff_pgm.sh
+PASS: ppm2tiff_ppm.sh
+PASS: tiffcp-g3.sh
+PASS: tiffcp-g3-1d.sh
+PASS: tiffcp-g3-1d-fill.sh
+PASS: tiffcp-g3-2d.sh
+PASS: tiffcp-g3-2d-fill.sh
+PASS: tiffcp-g4.sh
+PASS: tiffcp-logluv.sh
+PASS: tiffcp-thumbnail.sh
+PASS: tiffdump.sh
+PASS: tiffinfo.sh
+PASS: tiffcp-split.sh
+PASS: tiffcp-split-join.sh
+PASS: tiff2ps-PS1.sh
+PASS: tiff2ps-PS2.sh
+PASS: tiff2ps-PS3.sh
+PASS: tiff2ps-EPS1.sh
+PASS: tiff2pdf.sh
+PASS: tiffcrop-doubleflip-logluv-3c-16b.sh
+PASS: tiffcrop-doubleflip-minisblack-1c-16b.sh
+PASS: tiffcrop-doubleflip-minisblack-1c-8b.sh
+PASS: tiffcrop-doubleflip-minisblack-2c-8b-alpha.sh
+PASS: tiffcrop-doubleflip-miniswhite-1c-1b.sh
+PASS: tiffcrop-doubleflip-palette-1c-1b.sh
+PASS: tiffcrop-doubleflip-palette-1c-4b.sh
+PASS: tiffcrop-doubleflip-palette-1c-8b.sh
+PASS: tiffcrop-doubleflip-rgb-3c-16b.sh
+PASS: tiffcrop-doubleflip-rgb-3c-8b.sh
+PASS: tiffcrop-extract-logluv-3c-16b.sh
+PASS: tiffcrop-extract-minisblack-1c-16b.sh
+PASS: tiffcrop-extract-minisblack-1c-8b.sh
+PASS: tiffcrop-extract-minisblack-2c-8b-alpha.sh
+PASS: tiffcrop-extract-miniswhite-1c-1b.sh
+PASS: tiffcrop-extract-palette-1c-1b.sh
+PASS: tiffcrop-extract-palette-1c-4b.sh
+PASS: tiffcrop-extract-palette-1c-8b.sh
+PASS: tiffcrop-extract-rgb-3c-16b.sh
+PASS: tiffcrop-extract-rgb-3c-8b.sh
+PASS: tiffcrop-extractz14-logluv-3c-16b.sh
+PASS: tiffcrop-extractz14-minisblack-1c-16b.sh
+PASS: tiffcrop-extractz14-minisblack-1c-8b.sh
+PASS: tiffcrop-extractz14-minisblack-2c-8b-alpha.sh
+PASS: tiffcrop-extractz14-miniswhite-1c-1b.sh
+PASS: tiffcrop-extractz14-palette-1c-1b.sh
+PASS: tiffcrop-extractz14-palette-1c-4b.sh
+PASS: tiffcrop-extractz14-palette-1c-8b.sh
+PASS: tiffcrop-extractz14-rgb-3c-16b.sh
+PASS: tiffcrop-extractz14-rgb-3c-8b.sh
+PASS: tiffcrop-R90-logluv-3c-16b.sh
+PASS: tiffcrop-R90-minisblack-1c-16b.sh
+PASS: tiffcrop-R90-minisblack-1c-8b.sh
+PASS: tiffcrop-R90-minisblack-2c-8b-alpha.sh
+PASS: tiffcrop-R90-miniswhite-1c-1b.sh
+PASS: tiffcrop-R90-palette-1c-1b.sh
+PASS: tiffcrop-R90-palette-1c-4b.sh
+PASS: tiffcrop-R90-palette-1c-8b.sh
+PASS: tiffcrop-R90-rgb-3c-16b.sh
+PASS: tiffcrop-R90-rgb-3c-8b.sh
+PASS: tiff2rgba-logluv-3c-16b.sh
+PASS: tiff2rgba-minisblack-1c-16b.sh
+PASS: tiff2rgba-minisblack-1c-8b.sh
+PASS: tiff2rgba-minisblack-2c-8b-alpha.sh
+PASS: tiff2rgba-miniswhite-1c-1b.sh
+PASS: tiff2rgba-palette-1c-1b.sh
+PASS: tiff2rgba-palette-1c-4b.sh
+PASS: tiff2rgba-palette-1c-8b.sh
+PASS: tiff2rgba-rgb-3c-16b.sh
+PASS: tiff2rgba-rgb-3c-8b.sh
+PASS: tiff2rgba-quad-tile.jpg.sh
+# TOTAL: 81
+# PASS:  81
+# SKIP:  0
+# XFAIL: 0
+# FAIL:  0
+# XPASS: 0
+# ERROR: 0
--- a/components/meta-packages/incorporation-cache	Wed Mar 02 08:40:04 2016 -0800
+++ b/components/meta-packages/incorporation-cache	Thu Mar 17 08:44:16 2016 -0700
@@ -189,10 +189,7 @@
 consolidation/userland/userland-incorporation:image/library/[email protected]
 consolidation/userland/userland-incorporation:image/library/[email protected]
 consolidation/userland/userland-incorporation:image/library/[email protected]
-consolidation/userland/userland-incorporation:image/library/[email protected]
-consolidation/userland/userland-incorporation:image/library/[email protected]
 consolidation/userland/userland-incorporation:image/library/[email protected]
-consolidation/userland/userland-incorporation:image/library/[email protected]
 consolidation/userland/userland-incorporation:image/viewer/eog/[email protected]
 consolidation/userland/userland-incorporation:image/viewer/[email protected]
 consolidation/userland/userland-incorporation:library/accessibility/[email protected]