[gentoo-commits] repo/gentoo:master commit in: media-gfx/xv/, media-gfx/xv/files/
commit: f9a6f7546f212a395c157b35926e8a1dc4556c4a Author: David Seifert gentoo org> AuthorDate: Mon Jan 25 10:57:17 2016 + Commit: David Seifert gentoo org> CommitDate: Mon Jan 25 10:57:31 2016 + URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f9a6f754 media-gfx/xv: Fix -Werror=format-security errors Gentoo-Bug: 542134 * EAPI=6 * Amended all patches to be compatible with -p1 Package-Manager: portage-2.2.27 .../xv/files/xv-3.10a-disable-jp2k-20070520.patch | 4 +- media-gfx/xv/files/xv-3.10a-libpng15-r1.patch | 8 +- media-gfx/xv/files/xv-3.10a-osx-bsd-20070520.patch | 4 +- .../xv/files/xv-3.10a-vdcomp-osx-20070520.patch| 4 +- media-gfx/xv/files/xv-3.10a-wformat-security.patch | 19 + media-gfx/xv/xv-3.10a-r18.ebuild | 86 ++ 6 files changed, 115 insertions(+), 10 deletions(-) diff --git a/media-gfx/xv/files/xv-3.10a-disable-jp2k-20070520.patch b/media-gfx/xv/files/xv-3.10a-disable-jp2k-20070520.patch index 41d3023..7e42484 100644 --- a/media-gfx/xv/files/xv-3.10a-disable-jp2k-20070520.patch +++ b/media-gfx/xv/files/xv-3.10a-disable-jp2k-20070520.patch @@ -1,5 +1,5 @@ Makefile~ 2007-06-24 15:41:58 -0600 -+++ Makefile 2007-06-24 15:42:43 -0600 +--- xv-3.10a/Makefile~ 2007-06-24 15:41:58 -0600 xv-3.10a/Makefile 2007-06-24 15:42:43 -0600 @@ -176,16 +176,16 @@ ### if, for whatever reason, you're unable to get the JasPer JPEG-2000 library ### to compile on your machine, *COMMENT OUT* the following lines diff --git a/media-gfx/xv/files/xv-3.10a-libpng15-r1.patch b/media-gfx/xv/files/xv-3.10a-libpng15-r1.patch index b3eaeef..9905c4b 100644 --- a/media-gfx/xv/files/xv-3.10a-libpng15-r1.patch +++ b/media-gfx/xv/files/xv-3.10a-libpng15-r1.patch @@ -1,5 +1,5 @@ xvinfo.c -+++ xvinfo.c +--- xv-3.10a/xvinfo.c xv-3.10a/xvinfo.c @@ -26,7 +26,7 @@ #define INFOHIGH 270 @@ -9,8 +9,8 @@ /* baseline of top line of text */ #define TOPBASE (36 + penn_height/2 + 4 + 8 + ASCENT) xvpng.c -+++ xvpng.c +--- xv-3.10a/xvpng.c xv-3.10a/xvpng.c @@ -31,6 +31,7 @@ #ifdef HAVE_PNG diff --git a/media-gfx/xv/files/xv-3.10a-osx-bsd-20070520.patch b/media-gfx/xv/files/xv-3.10a-osx-bsd-20070520.patch index 59a768e..ecafd1d 100644 --- a/media-gfx/xv/files/xv-3.10a-osx-bsd-20070520.patch +++ b/media-gfx/xv/files/xv-3.10a-osx-bsd-20070520.patch @@ -1,5 +1,5 @@ xv.h~ 2007-06-24 14:30:42 -0600 -+++ xv.h 2007-06-24 14:42:04 -0600 +--- xv-3.10a/xv.h~ 2007-06-24 14:30:42 -0600 xv-3.10a/xv.h 2007-06-24 14:42:04 -0600 @@ -158,7 +158,7 @@ #ifndef VMS diff --git a/media-gfx/xv/files/xv-3.10a-vdcomp-osx-20070520.patch b/media-gfx/xv/files/xv-3.10a-vdcomp-osx-20070520.patch index 06e9f8a..2c82b1a 100644 --- a/media-gfx/xv/files/xv-3.10a-vdcomp-osx-20070520.patch +++ b/media-gfx/xv/files/xv-3.10a-vdcomp-osx-20070520.patch @@ -1,5 +1,5 @@ vdcomp.c~ 2007-06-24 14:30:42 -0600 -+++ vdcomp.c 2007-06-24 14:48:12 -0600 +--- xv-3.10a/vdcomp.c~ 2007-06-24 14:30:42 -0600 xv-3.10a/vdcomp.c 2007-06-24 14:48:12 -0600 @@ -123,6 +123,8 @@ #if defined(hp300) || defined(hp800) || defined(NeXT) diff --git a/media-gfx/xv/files/xv-3.10a-wformat-security.patch b/media-gfx/xv/files/xv-3.10a-wformat-security.patch new file mode 100644 index 000..34d2c19 --- /dev/null +++ b/media-gfx/xv/files/xv-3.10a-wformat-security.patch @@ -0,0 +1,19 @@ +Fix errors caused by -Wformat -Werror=format-security +https://bugs.gentoo.org/show_bug.cgi?id=542134 + +* xvpbm.c:888:4: error: format not a string literal and no format arguments [-Werror=format-security] +* if (*pix) fprintf(fp,str1); + +--- xv-3.10a/xvpbm.c xv-3.10a/xvpbm.c +@@ -885,8 +885,8 @@ + } + } + else { +-if (*pix) fprintf(fp,str1); +- else fprintf(fp,str0); ++if (*pix) fprintf(fp,"%s",str1); ++ else fprintf(fp,"%s",str0); + len+=2; + if (len>68) { fprintf(fp,"\n"); len=0; } + } diff --git a/media-gfx/xv/xv-3.10a-r18.ebuild b/media-gfx/xv/xv-3.10a-r18.ebuild new file mode 100644 index 000..795224b --- /dev/null +++ b/media-gfx/xv/xv-3.10a-r18.ebuild @@ -0,0 +1,86 @@ +# Copyright 1999-2016 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +EAPI=6 + +inherit eutils flag-o-matic + +JUMBOV=20070520 +DESCRIPTION="Interactive image manipulation program supporting a wide variety of formats" +HOMEPAGE="http://www.trilon.com/xv/index.html http://www.sonic.net/~roelofs/greg_xv.html"; +SRC_URI="mirror://sourceforge/png-mng/${P}-jumbo-patches-${JUMBOV}.tar.gz + ftp://ftp.cis.upenn.edu/pub/xv/${P}.tar.gz + mirror://gentoo/${P}.png.bz2" + +LICENSE="xv" +SLOT="0" +KEYWORDS="~alpha ~amd64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86 ~x86-fbsd ~x86-freebsd ~amd64-linux ~x86-linux ~ppc-macos" +IUSE="jpeg tiff png" + +DEPEND="x11-libs/libXt + jpeg? ( virtual/jpeg:0
[gentoo-commits] repo/gentoo:master commit in: media-gfx/xv/, media-gfx/xv/files/
commit: a0036cb21b2b3543f50c3964039dc96c54e47f6f Author: Pacho Ramos gentoo org> AuthorDate: Sun Nov 8 11:02:16 2015 + Commit: Pacho Ramos gentoo org> CommitDate: Sun Nov 8 11:04:11 2015 + URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a0036cb2 media-gfx/xv: Fix png crashes (#521142 by Ian Schram) Package-Manager: portage-2.2.24 media-gfx/xv/files/xv-3.10a-libpng15-r1.patch | 520 ++ media-gfx/xv/xv-3.10a-r17.ebuild | 92 + 2 files changed, 612 insertions(+) diff --git a/media-gfx/xv/files/xv-3.10a-libpng15-r1.patch b/media-gfx/xv/files/xv-3.10a-libpng15-r1.patch new file mode 100644 index 000..b3eaeef --- /dev/null +++ b/media-gfx/xv/files/xv-3.10a-libpng15-r1.patch @@ -0,0 +1,520 @@ +--- xvinfo.c xvinfo.c +@@ -26,7 +26,7 @@ + #define INFOHIGH 270 + + /* max length of an Info String */ +-#define ISTRLEN 80 ++#define ISTRLEN 256 + + /* baseline of top line of text */ + #define TOPBASE (36 + penn_height/2 + 4 + 8 + ASCENT) +--- xvpng.c xvpng.c +@@ -31,6 +31,7 @@ + + #ifdef HAVE_PNG + ++#include "zlib.h" + #include "png.h" + + /*** Stuff for PNG Dialog box ***/ +@@ -41,7 +42,9 @@ + #define COMPRESSION 6 /* default zlib compression level, not max +(Z_BEST_COMPRESSION) */ + +-#define HAVE_tRNS (info_ptr->valid & PNG_INFO_tRNS) ++/* old ++#define HAVE_tRNS (info_ptr->valid & PNG_INFO_tRNS) */ ++#define HAVE_tRNS png_get_valid(png_ptr,info_ptr,PNG_INFO_tRNS) + + #define DWIDE86 + #define DHIGH104 +@@ -444,6 +447,10 @@ + byte *p, *png_line; + charsoftware[256]; + char *savecmnt; ++ /* for storing values until all are accumulated, so that the image header can be set in full */ ++ int _bit_depth,_color_type,_interlace_type,_compression_type,_filter_type; ++ png_uint_32 _width,_height; ++ png_time_mod_time; + + if ((png_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING, NULL, +png_xv_error, png_xv_warning)) == NULL) { +@@ -458,7 +465,7 @@ + FatalError(software); + } + +- if (setjmp(png_ptr->jmpbuf)) { ++ if (setjmp(png_jmpbuf(png_ptr))) { + png_destroy_write_struct(&png_ptr, &info_ptr); + return -1; + } +@@ -489,8 +496,8 @@ + png_set_filter(png_ptr, 0, filter); + } + +- info_ptr->width = w; +- info_ptr->height = h; ++ _width = w; ++ _height = h; + if (w <= 0 || h <= 0) { + SetISTR(ISTR_WARNING, "%s: image dimensions out of range (%dx%d)", + fbasename, w, h); +@@ -498,7 +505,7 @@ + return -1; + } + +- info_ptr->interlace_type = interCB.val ? 1 : 0; ++ _interlace_type = interCB.val ? PNG_INTERLACE_ADAM7 : PNG_INTERLACE_NONE; + + linesize = 0; /* quiet a compiler warning */ + +@@ -542,40 +549,44 @@ + png_destroy_write_struct(&png_ptr, &info_ptr); + return -1; + } +- info_ptr->color_type = PNG_COLOR_TYPE_RGB; +- info_ptr->bit_depth = 8; ++ _color_type = PNG_COLOR_TYPE_RGB; ++ _bit_depth = 8; + } else /* ptype == PIC8 */ { + linesize = w; +- info_ptr->color_type = PNG_COLOR_TYPE_PALETTE; ++ _color_type = PNG_COLOR_TYPE_PALETTE; + if (numuniqcols <= 2) +-info_ptr->bit_depth = 1; ++_bit_depth = 1; + else + if (numuniqcols <= 4) +-info_ptr->bit_depth = 2; ++_bit_depth = 2; + else + if (numuniqcols <= 16) +-info_ptr->bit_depth = 4; ++_bit_depth = 4; + else +-info_ptr->bit_depth = 8; ++_bit_depth = 8; + + for (i = 0; i < numuniqcols; i++) { + palette[i].red = r1[i]; + palette[i].green = g1[i]; + palette[i].blue = b1[i]; + } +- info_ptr->num_palette = numuniqcols; +- info_ptr->palette = palette; ++/* cannot find a setter for this, unsure if it is necessary anymore... + info_ptr->valid |= PNG_INFO_PLTE; ++*/ ++ /* set the header just in case it's needed */ ++ png_set_IHDR(png_ptr,info_ptr,_width,_height,_bit_depth,_color_type, ++_interlace_type,PNG_COMPRESSION_TYPE_DEFAULT,PNG_FILTER_TYPE_DEFAULT); ++ png_set_PLTE(png_ptr,info_ptr,palette,numuniqcols); + } + } + + else if (colorType == F_GREYSCALE || colorType == F_BWDITHER) { +-info_ptr->color_type = PNG_COLOR_TYPE_GRAY; ++_color_type = PNG_COLOR_TYPE_GRAY; + if (colorType == F_BWDITHER) { + /* shouldn't happen */ + if (ptype == PIC24) FatalError("PIC24 and B/W Stipple in WritePNG()"); + +- info_ptr->bit_depth = 1; ++ _bit_depth = 1; + if (MONO(r1[0], g1[0], b1[0]) > MONO(r1[1], g1[1], b1[1])) { + remap[0] = 1; + remap[1] = 0; +@@ -595,7 +606,7 @@ + png_destroy_write_struct(&png_ptr, &info_ptr); + return -1; + } +-info_ptr->bit_depth = 8; ++_bit_depth = 8; + } + else /* ptype == PIC8 */ { + int low_precision; +@@ -617,7 +628,7 @@ + f