diff options
author | Joe Peterson <lavajoe@gentoo.org> | 2008-05-07 12:41:40 +0000 |
---|---|---|
committer | Joe Peterson <lavajoe@gentoo.org> | 2008-05-07 12:41:40 +0000 |
commit | 6436268ca32f405516ae1c5f501a6e4907ad484b (patch) | |
tree | 74cb977ca776ee083826da332b399301260ba01d /media-gfx/xv/files | |
parent | Version bump and old version cleanup (diff) | |
download | gentoo-2-6436268ca32f405516ae1c5f501a6e4907ad484b.tar.gz gentoo-2-6436268ca32f405516ae1c5f501a6e4907ad484b.tar.bz2 gentoo-2-6436268ca32f405516ae1c5f501a6e4907ad484b.zip |
Remove old patches; fix docpath in make (no effect)
(Portage version: 2.1.4.4)
Diffstat (limited to 'media-gfx/xv/files')
-rw-r--r-- | media-gfx/xv/files/jumbo-patch-nojpeg.diff | 11 | ||||
-rw-r--r-- | media-gfx/xv/files/xv-3.10a-bmpfix.patch | 133 | ||||
-rw-r--r-- | media-gfx/xv/files/xv-3.10a-makefile-osx.patch | 20 | ||||
-rw-r--r-- | media-gfx/xv/files/xv-3.10a-osx-bsd.patch | 51 | ||||
-rw-r--r-- | media-gfx/xv/files/xv-3.10a-ppc.patch | 11 | ||||
-rw-r--r-- | media-gfx/xv/files/xv-3.10a-security.diff | 138 | ||||
-rw-r--r-- | media-gfx/xv/files/xv-3.10a-vdcomp-osx.patch | 11 | ||||
-rw-r--r-- | media-gfx/xv/files/xv-3.10a-xv-osx.patch | 20 | ||||
-rw-r--r-- | media-gfx/xv/files/xv-3.10a-yaos.diff | 471 | ||||
-rw-r--r-- | media-gfx/xv/files/xv-filename-format-string.diff | 11 | ||||
-rw-r--r-- | media-gfx/xv/files/xv-optimize-jpeg.diff | 18 | ||||
-rw-r--r-- | media-gfx/xv/files/xv-postscript-double-free.diff | 30 | ||||
-rw-r--r-- | media-gfx/xv/files/xv-smoothing-algorithm.diff | 172 | ||||
-rw-r--r-- | media-gfx/xv/files/xv-use-getcwd.patch | 10 |
14 files changed, 0 insertions, 1107 deletions
diff --git a/media-gfx/xv/files/jumbo-patch-nojpeg.diff b/media-gfx/xv/files/jumbo-patch-nojpeg.diff deleted file mode 100644 index cf45ab7064fb..000000000000 --- a/media-gfx/xv/files/jumbo-patch-nojpeg.diff +++ /dev/null @@ -1,11 +0,0 @@ ---- xv-3.10a-jumbo-enh-patch-20050501.txt.orig 2005-05-01 15:51:22.000000000 -0500 -+++ xv-3.10a-jumbo-enh-patch-20050501.txt 2005-10-12 10:08:39.000000000 -0500 -@@ -7503,7 +7503,7 @@ - if (wasTiffUp) { TIFFDialog(wasTiffUp); wasTiffUp=0; } - #endif - +#ifdef HAVE_PNG --+ if (wasPngUp) { PNGDialog(wasJpegUp); wasPngUp=0; } -++ if (wasPngUp) { PNGDialog(wasPngUp); wasPngUp=0; } - +#endif - +#ifdef HAVE_PCD - + if (wasPcdUp) { PCDDialog(wasPcdUp); wasPcdUp=0; } diff --git a/media-gfx/xv/files/xv-3.10a-bmpfix.patch b/media-gfx/xv/files/xv-3.10a-bmpfix.patch deleted file mode 100644 index fabaa63e57dd..000000000000 --- a/media-gfx/xv/files/xv-3.10a-bmpfix.patch +++ /dev/null @@ -1,133 +0,0 @@ ---- xv-3.10a/xvbmp.c -+++ xv-3.10a/xvbmp.c Mon Apr 11 18:45:16 2005 -@@ -190,14 +190,12 @@ - bPad -= 12; - } - -- /* load up colormap, if any */ -- if (biBitCount==1 || biBitCount==4 || biBitCount==8) { -- int i, cmaplen; -- --/* this is superfluous; see identical test in "error checking" block above - if (biClrUsed > (1 << biBitCount)) - biClrUsed = (1 << biBitCount); -- */ -+ -+ /* load up colormap, if any */ -+ if (biBitCount == 1 || biBitCount == 4 || biBitCount == 8) { -+ int i, cmaplen; - - cmaplen = (biClrUsed) ? biClrUsed : 1 << biBitCount; - for (i=0; i<cmaplen; i++) { -@@ -343,12 +341,13 @@ - u_int w,h; - { - int i,j,c,bitnum,padw; -- byte *pp; -+ byte *pp = pic8 + ((h - 1) * w); -+ size_t l = w*h; - - c = 0; - padw = ((w + 31)/32) * 32; /* 'w', padded to be a multiple of 32 */ - -- for (i=h-1; i>=0; i--) { -+ for (i=h-1; i>=0 && (pp - pic8 <= l); i--) { - pp = pic8 + (i * w); - if ((i&0x3f)==0) WaitCursor(); - for (j=bitnum=0; j<padw; j++,bitnum++) { -@@ -377,8 +376,8 @@ - u_int w,h,comp; - { - int i,j,c,c1,x,y,nybnum,padw,rv; -- byte *pp; -- -+ byte *pp = pic8 + ((h - 1) * w); -+ size_t l = w*h; - - rv = 0; - c = c1 = 0; -@@ -386,7 +385,7 @@ - if (comp == BI_RGB) { /* read uncompressed data */ - padw = ((w + 7)/8) * 8; /* 'w' padded to a multiple of 8pix (32 bits) */ - -- for (i=h-1; i>=0; i--) { -+ for (i=h-1; i>=0 && (pp - pic8 <= l); i--) { - pp = pic8 + (i * w); - if ((i&0x3f)==0) WaitCursor(); - -@@ -414,7 +413,7 @@ - - if (c) { /* encoded mode */ - c1 = getc(fp); -- for (i=0; i<c; i++,x++,pp++) -+ for (i=0; i<c && (pp - pic8 <= l); i++,x++,pp++) - *pp = (i&1) ? (c1 & 0x0f) : ((c1>>4)&0x0f); - } - -@@ -434,7 +433,7 @@ - } - - else { /* absolute mode */ -- for (i=0; i<c; i++, x++, pp++) { -+ for (i=0; i<c && (pp - pic8 <= l); i++, x++, pp++) { - if ((i&1) == 0) c1 = getc(fp); - *pp = (i&1) ? (c1 & 0x0f) : ((c1>>4)&0x0f); - } -@@ -463,7 +462,9 @@ - u_int w,h,comp; - { - int i,j,c,c1,padw,x,y,rv; -- byte *pp, *pend; -+ byte *pp = pic8 + ((h - 1) * w); -+ size_t l = w*h; -+ byte *pend; - - rv = 0; - -@@ -472,7 +473,7 @@ - if (comp == BI_RGB) { /* read uncompressed data */ - padw = ((w + 3)/4) * 4; /* 'w' padded to a multiple of 4pix (32 bits) */ - -- for (i=h-1; i>=0; i--) { -+ for (i=h-1; i>=0 && (pp - pic8 <= l); i--) { - pp = pic8 + (i * w); - if ((i&0x3f)==0) WaitCursor(); - -@@ -541,7 +542,8 @@ - u_int w, h, *mask; - { - int x, y; -- byte *pp; -+ byte *pp = pic24 + ((h - 1) * w * 3); -+ size_t l = w*h*3; - u_int buf, colormask[6]; - int i, bit, bitshift[6], colorbits[6], bitshift2[6]; - -@@ -611,7 +613,7 @@ - colorbits[2], colormask[2], bitshift[2], bitshift2[2], - colormask[5], bitshift[5], bitshift2[5]); - -- for (y = h-1; y >= 0; y--) { -+ for (y = h-1; y >= 0 && (pp - pic24 <= l); y--) { - pp = pic24 + (3 * w * y); - if ((y&0x3f)==0) WaitCursor(); - -@@ -644,7 +646,8 @@ - u_int w,h, bits; - { - int i,j,padb,rv; -- byte *pp; -+ byte *pp = pic24 + ((h - 1) * w * 3); -+ size_t l = w*h*3; - - rv = 0; - -@@ -655,7 +658,7 @@ - pp = pic24 + (i * w * 3); - if ((i&0x3f)==0) WaitCursor(); - -- for (j=0; j<w; j++) { -+ for (j=0; j<w && (pp - pic24 <= l); j++) { - pp[2] = getc(fp); /* blue */ - pp[1] = getc(fp); /* green */ - pp[0] = getc(fp); /* red */ diff --git a/media-gfx/xv/files/xv-3.10a-makefile-osx.patch b/media-gfx/xv/files/xv-3.10a-makefile-osx.patch deleted file mode 100644 index 8dc6f6335720..000000000000 --- a/media-gfx/xv/files/xv-3.10a-makefile-osx.patch +++ /dev/null @@ -1,20 +0,0 @@ ---- Makefile.orig Mon Aug 23 00:49:23 2004 -+++ Makefile Mon Aug 23 00:36:19 2004 -@@ -123,7 +123,7 @@ - - - ### for LINUX, uncomment the following line --MCHN = -DLINUX -+#MCHN = -DLINUX - - - # For SCO 1.1 (UNIX 3.2v2) machines, uncomment the following: -@@ -184,7 +184,7 @@ - # if, during compilation, your system complains about the types - # 'u_long', 'u_short', 'u_int', etc. as being undefined, uncomment the - # following line: --BSDTYPES = -DBSDTYPES -+#BSDTYPES = -DBSDTYPES - - - # if your machine doesn't have 'vprintf()' or 'vsprintf()' diff --git a/media-gfx/xv/files/xv-3.10a-osx-bsd.patch b/media-gfx/xv/files/xv-3.10a-osx-bsd.patch deleted file mode 100644 index 4d5fecdd2d6c..000000000000 --- a/media-gfx/xv/files/xv-3.10a-osx-bsd.patch +++ /dev/null @@ -1,51 +0,0 @@ ---- xv.h.orig 2005-10-31 20:49:18.000000000 +0100 -+++ xv.h 2005-10-31 22:10:17.000000000 +0100 -@@ -157,7 +157,7 @@ - - #ifndef VMS - # include <errno.h> --# ifndef __NetBSD__ -+# if !defined(__NetBSD__) && !defined(__FreeBSD__) && !defined(__APPLE__) - # if !(defined __GLIBC__ && __GLIBC__ >= 2) - extern int errno; /* SHOULD be in errno.h, but often isn't */ - extern char *sys_errlist[]; /* this too... */ -@@ -170,7 +170,7 @@ - #ifdef VMS - # define ERRSTR(x) strerror(x, vaxc$errno) - #else --# if defined(__BEOS__) || defined(__linux__) /* or all modern/glibc systems? */ -+# if defined(__BEOS__) || defined(__linux__) || defined(__APPLE__) /* or all modern/glibc systems? */ - # define ERRSTR(x) strerror(x) - # else - # define ERRSTR(x) sys_errlist[x] -@@ -214,6 +214,8 @@ - - # if defined(hp300) || defined(hp800) || defined(NeXT) - # include <sys/malloc.h> /* it's in 'sys' on HPs and NeXT */ -+# elif defined(__APPLE__) -+# include <malloc/malloc.h> - # else - # include <malloc.h> - # endif -@@ -347,7 +347,11 @@ - #endif - - #ifndef S_IRWUSR --# define S_IRWUSR (S_IRUSR|__S_IWRITE) -+# if defined(__FreeBSD__) || defined(__APPLE__) -+# define S_IRWUSR (S_IRUSR|S_IWUSR) -+# else -+# define S_IRWUSR (S_IRUSR|__S_IWRITE) -+# endif - #endif - - #ifndef MAXPATHLEN -@@ -380,7 +380,7 @@ - * them later. */ - #ifndef VMS /* VMS hates multi-line definitions */ - # if defined(__linux__) || defined(__OpenBSD__) || defined(__NetBSD__) || \ -- defined(__bsdi__) -+ defined(__FreeBSD__) || defined(__bsdi__) || defined(__APPLE__) - # ifndef USE_MKSTEMP - # define USE_MKSTEMP /* use 'mkstemp()' instead of 'mktemp()' */ - # endif /* >> SECURITY ISSUE << */ diff --git a/media-gfx/xv/files/xv-3.10a-ppc.patch b/media-gfx/xv/files/xv-3.10a-ppc.patch deleted file mode 100644 index c73b5f493608..000000000000 --- a/media-gfx/xv/files/xv-3.10a-ppc.patch +++ /dev/null @@ -1,11 +0,0 @@ -diff -urN xv-3.10a.enhanced.gentoo/tiff/Makefile xv-3.10a/tiff/Makefile ---- xv-3.10a.enhanced.gentoo/tiff/Makefile 1994-12-23 07:35:12.000000000 +0900 -+++ xv-3.10a/tiff/Makefile 2003-08-14 22:35:04.000000000 +0900 -@@ -60,7 +60,6 @@ - - ${ALL}: ${OBJS} - ${AR} rc libtiff.a $? -- ${RANLIB} libtiff.a - - ${OBJS}: tiffio.h tiff.h tiffcomp.h tiffiop.h tiffconf.h - diff --git a/media-gfx/xv/files/xv-3.10a-security.diff b/media-gfx/xv/files/xv-3.10a-security.diff deleted file mode 100644 index d49f23292c91..000000000000 --- a/media-gfx/xv/files/xv-3.10a-security.diff +++ /dev/null @@ -1,138 +0,0 @@ ---- xvbmp.c -+++ xvbmp.c Tue Aug 24 12:42:52 2004 -@@ -129,7 +129,9 @@ - /* error checking */ - if ((biBitCount!=1 && biBitCount!=4 && biBitCount!=8 && - biBitCount!=24 && biBitCount!=32) || -- biPlanes!=1 || biCompression>BI_RLE4) { -+ biPlanes!=1 || biCompression>BI_RLE4 || -+ biWidth<= 0 || biHeight <= 0 || -+ (biClrUsed && biClrUsed > (1 << biBitCount))) { - - sprintf(buf,"Bogus BMP File! (bitCount=%d, Planes=%d, Compression=%d)", - biBitCount, biPlanes, biCompression); -@@ -159,6 +161,9 @@ - - bPad = bfOffBits - (biSize + 14); - } -+ -+ if (biClrUsed > (1 << biBitCount)) -+ biClrUsed = (1 << biBitCount); - - /* load up colormap, if any */ - if (biBitCount!=24 && biBitCount!=32) { ---- xviris.c -+++ xviris.c Tue Aug 24 13:01:42 2004 -@@ -267,6 +267,12 @@ - - rlebuflen = 2 * xsize + 10; - tablen = ysize * zsize; -+ -+ if (rlebuflen <= 0 || tablen <= 0 || (tablen * sizeof(long)) < 0) { -+ loaderr = "Bogus IRIS File!"; -+ return (byte *)NULL; -+ } -+ - starttab = (u_long *) malloc((size_t) tablen * sizeof(long)); - lengthtab = (u_long *) malloc((size_t) tablen * sizeof(long)); - rledat = (byte *) malloc((size_t) rlebuflen); ---- xvpcx.c -+++ xvpcx.c Tue Aug 24 13:12:15 2004 -@@ -222,7 +222,14 @@ - byte *image; - - /* note: overallocation to make life easier... */ -- image = (byte *) malloc((size_t) (pinfo->h + 1) * pinfo->w + 16); -+ int count = (pinfo->h + 1) * pinfo->w + 16; -+ -+ if (count <= 0 || pinfo->h <= 0 || pinfo->w <= 0) { -+ pcxError(fname, "Bogus PCX file!!"); -+ return (0); -+ } -+ -+ image = (byte *) malloc((size_t) count); - if (!image) FatalError("Can't alloc 'image' in pcxLoadImage8()"); - - xvbzero((char *) image, (size_t) ((pinfo->h+1) * pinfo->w + 16)); -@@ -250,17 +257,25 @@ - { - byte *pix, *pic24, scale[256]; - int c, i, j, w, h, maxv, cnt, planes, bperlin, nbytes; -+ int count; - - w = pinfo->w; h = pinfo->h; - - planes = (int) hdr[PCX_PLANES]; - bperlin = hdr[PCX_BPRL] + ((int) hdr[PCX_BPRH]<<8); - -+ count = w*h*planes; -+ -+ if (count <= 0 || planes <= 0 || w <= 0 || h <= 0) { -+ pcxError(fname, "Bogus PCX file!!"); -+ return (0); -+ } -+ - /* allocate 24-bit image */ -- pic24 = (byte *) malloc((size_t) w*h*planes); -+ pic24 = (byte *) malloc((size_t) count); - if (!pic24) FatalError("couldn't malloc 'pic24'"); - -- xvbzero((char *) pic24, (size_t) w*h*planes); -+ xvbzero((char *) pic24, (size_t) count); - - maxv = 0; - pix = pinfo->pic = pic24; -@@ -268,6 +283,12 @@ - j = 0; /* bytes per line, in this while loop */ - nbytes = bperlin*h*planes; - -+ if (nbytes < 0) { -+ pcxError(fname, "Bogus PCX file!!"); -+ free(pic24); -+ return (0); -+ } -+ - while (nbytes > 0 && (c = getc(fp)) != EOF) { - if ((c & 0xC0) == 0xC0) { /* have a rep. count */ - cnt = c & 0x3F; ---- xvpm.c -+++ xvpm.c Tue Aug 24 13:16:43 2004 -@@ -119,6 +119,9 @@ - - isize = pm_isize(&thePic); - -+ if (isize <= 0) -+ return pmError(bname, "Bogus PM file!!"); -+ - if (DEBUG) - fprintf(stderr,"%s: LoadPM() - loading a %dx%d %s pic, %d planes\n", - cmd, w, h, (thePic.pm_form==PM_I) ? "PM_I" : "PM_C", -@@ -135,6 +138,8 @@ - return( pmError(bname, "file read error") ); - } - -+ if (thePic.pm_cmtsize+1 <= 0) -+ return pmError(bname, "Bogus PM file!!"); - - /* alloc and read in comment, if any */ - if (thePic.pm_cmtsize>0) { -@@ -155,6 +160,9 @@ - int *intptr; - byte *pic24, *picptr; - -+ if (w <= 0 || h <= 0 || w*h*3 <= 0) -+ return pmError(bname, "Bogus PM file!!"); -+ - if ((pic24 = (byte *) malloc((size_t) w*h*3))==NULL) { - if (thePic.pm_cmt) free(thePic.pm_cmt); - return( pmError(bname, "unable to malloc 24-bit picture") ); -@@ -189,6 +197,9 @@ - - else if (thePic.pm_form == PM_C && thePic.pm_np>1) { - byte *pic24, *picptr, *rptr, *gptr, *bptr; -+ -+ if (w <= 0 || h <= 0 || w*h*3 <= 0) -+ return pmError(bname, "Bogus PM file!!"); - - if ((pic24 = (byte *) malloc((size_t) w*h*3))==NULL) { - if (thePic.pm_cmt) free(thePic.pm_cmt); diff --git a/media-gfx/xv/files/xv-3.10a-vdcomp-osx.patch b/media-gfx/xv/files/xv-3.10a-vdcomp-osx.patch deleted file mode 100644 index d05c67967a85..000000000000 --- a/media-gfx/xv/files/xv-3.10a-vdcomp-osx.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- vdcomp.c.orig Mon Aug 23 00:47:40 2004 -+++ vdcomp.c Mon Aug 23 00:43:34 2004 -@@ -112,6 +112,8 @@ - - # if defined(hp300) || defined(hp800) || defined(NeXT) - # include <sys/malloc.h> /* it's in 'sys' on HPs and NeXT */ -+# elif defined(__APPLE__) -+# include <malloc/malloc.h> - # else - # include <malloc.h> - # endif diff --git a/media-gfx/xv/files/xv-3.10a-xv-osx.patch b/media-gfx/xv/files/xv-3.10a-xv-osx.patch deleted file mode 100644 index dff79f8719a0..000000000000 --- a/media-gfx/xv/files/xv-3.10a-xv-osx.patch +++ /dev/null @@ -1,20 +0,0 @@ ---- xv.h.orig Mon Aug 23 00:36:59 2004 -+++ xv.h Mon Aug 23 00:42:13 2004 -@@ -115,7 +115,7 @@ - #ifndef VMS - # include <errno.h> - extern int errno; /* SHOULD be in errno.h, but often isn't */ --# ifndef __NetBSD__ -+# if defined (__NetBSD__) && !defined(__APPLE__) - extern char *sys_errlist[]; /* this too... */ - # endif - #endif -@@ -163,6 +163,8 @@ - - # if defined(hp300) || defined(hp800) || defined(NeXT) - # include <sys/malloc.h> /* it's in 'sys' on HPs and NeXT */ -+# elif defined(__APPLE__) -+# include <malloc/malloc.h> - # else - # include <malloc.h> - # endif diff --git a/media-gfx/xv/files/xv-3.10a-yaos.diff b/media-gfx/xv/files/xv-3.10a-yaos.diff deleted file mode 100644 index 5157a65ea523..000000000000 --- a/media-gfx/xv/files/xv-3.10a-yaos.diff +++ /dev/null @@ -1,471 +0,0 @@ ---- xvbrowse.c -+++ xvbrowse.c Wed Apr 13 15:35:17 2005 -@@ -5309,7 +5309,51 @@ - SetCursors(-1); - } - -+static int recursive_remove(dir) -+ char *dir; -+{ -+ DIR *dp = NULL; -+ struct dirent *di; -+ char name[MAXPATHLEN+1]; -+ -+ strncpy(name, dir, MAXPATHLEN); -+ name[MAXPATHLEN] = 0; -+ -+ if (name[strlen(name) - 1] == '/') -+ name[strlen(name) - 1] = 0; -+ -+ if ((dp = opendir(name)) == NULL) -+ goto err; -+ -+ while ((di = readdir(dp)) != NULL) { -+ char buf[MAXPATHLEN+1]; -+ struct stat st; -+ -+ if (!strcmp(di->d_name, ".") || !strcmp(di->d_name, "..")) -+ continue; -+ -+ snprintf(buf, MAXPATHLEN, "%s/%s", name, di->d_name); -+ -+ if (stat(buf, &st) < 0) -+ continue; -+ -+ if (S_ISDIR(st.st_mode)) { -+ if (recursive_remove(buf) < 0) -+ goto err; -+ } else -+ unlink(buf); -+ } -+ -+ if (rmdir(name) < 0) -+ goto err; - -+ closedir(dp); -+ return 0; -+ -+err: -+ if (dp) closedir(dp); -+ return -1; -+} - - /*************************************************/ - static int moveFile(src,dst) -@@ -5352,7 +5396,7 @@ - #endif - - if (overwrite==OWRT_ASK) { -- sprintf(buf, "%s '%s' exists.\n\nOverwrite?", -+ snprintf(buf, sizeof(buf), "%s '%s' exists.\n\nOverwrite?", - dstdir ? "Directory" : "File", dst); - i = PopUp(buf, owbuts, 4); - -@@ -5363,8 +5407,7 @@ - - if (dstdir) { - #ifndef VMS /* we don't delete directories in VMS */ -- sprintf(buf, "rm -rf %s", dst); -- if (system(buf)) { /* okay, so it's cheating... */ -+ if (recursive_remove(dst)) { /* okay, so it's cheating... */ - SetISTR(ISTR_WARNING, "Unable to remove directory %s", dst); - return 1; - } -@@ -5387,9 +5430,8 @@ - if (i == 0) { /* copied okay, kill the original */ - if (srcdir) { - #ifndef VMS /* we don't delete directories in VMS */ -- sprintf(buf, "rm -rf %s", src); -- if (system(buf)) { /* okay, so it's cheating... */ -- SetISTR(ISTR_WARNING, "Unable to remove directory %s", dst); -+ if (recursive_remove(src)) { /* okay, so it's cheating... */ -+ SetISTR(ISTR_WARNING, "Unable to remove directory %s", src); - return 1; - } - #endif /* VMS */ ---- xvpds.c -+++ xvpds.c Wed Apr 13 15:01:24 2005 -@@ -77,8 +77,7 @@ - * Huffman-encoded, and the encoding histogram follows the ASCII headers. - * To decode these, we use a slightly modified version of "vdcomp.c" from the - * NASA Viking CD-ROMS. For xv to work, you need to have vdcomp compiled -- * and in your search path. vdcomp.c should be included with this --distribution. -+ * and in your search path. vdcomp.c should be included with this distribution. - * - * I've heard that newer discs have FITS images on them. If they do, support - * for them will be added when I get one. Until then, you can use fitstopgm. -@@ -129,27 +128,32 @@ - - /* This is arbitrary. Everything I've seen so far fits in 50 chars */ - #define COMMENTSIZE 50 -+#define INOTESIZE 1000 - - - static int lastwasinote = FALSE; --static char scanbuff [MAX_SIZE], -- rtbuff [RTBUFFSIZE], -- inote [20*COMMENTSIZE], -- infobuff [COMMENTSIZE], -- spacecraft [COMMENTSIZE], -- target [COMMENTSIZE], -- filtname [COMMENTSIZE], -- gainmode [COMMENTSIZE], -- editmode [COMMENTSIZE], -- scanmode [COMMENTSIZE], -- exposure [COMMENTSIZE], -- shuttermode [COMMENTSIZE], -- mphase [COMMENTSIZE], -- iname [COMMENTSIZE], -- itime [COMMENTSIZE], -- garbage [1020], -+static char scanbuff [MAX_SIZE+1], -+ rtbuff [RTBUFFSIZE+1], -+ inote [INOTESIZE+1], -+ infobuff [COMMENTSIZE+1], -+ spacecraft [COMMENTSIZE+1], -+ target [COMMENTSIZE+1], -+ filtname [COMMENTSIZE+1], -+ gainmode [COMMENTSIZE+1], -+ editmode [COMMENTSIZE+1], -+ scanmode [COMMENTSIZE+1], -+ exposure [COMMENTSIZE+1], -+ shuttermode [COMMENTSIZE+1], -+ mphase [COMMENTSIZE+1], -+ iname [COMMENTSIZE+1], -+ itime [COMMENTSIZE+1], -+ garbage [1024], - *tmptmp, - pdsuncompfname[FNAMESIZE]; -+ -+#define SSTR(l) "%" #l "s" -+#define S(l) SSTR(l) -+ - byte *image; - static int elaphe; - -@@ -397,7 +401,7 @@ - - if (strcmp(scanbuff,"END") == 0) { - break; -- } else if (sscanf(scanbuff," RECORD_TYPE = %s",rtbuff) == 1) { -+ } else if (sscanf(scanbuff, " RECORD_TYPE = " S(RTBUFFSIZE), rtbuff) == 1) { - if (strncmp(rtbuff,"VARIABLE_LENGTH", (size_t) 15) == 0) { - /* itype=PDSVARIABLE; */ - } else if (strncmp(rtbuff,"FIXED_LENGTH", (size_t) 12) == 0) { -@@ -416,7 +420,7 @@ - if (irecsize == 0) irecsize=recsize; - lastwasinote=FALSE; - continue; -- } else if (sscanf(scanbuff," FILE_TYPE = %s", rtbuff) != 0) { -+ } else if (sscanf(scanbuff, " FILE_TYPE = " S(RTBUFFSIZE), rtbuff) != 0) { - lastwasinote=FALSE; - if (strncmp(rtbuff,"IMAGE", (size_t) 5) == 0) { - isimage=TRUE; -@@ -445,74 +449,74 @@ - lastwasinote=FALSE; continue; - } else if (sscanf(scanbuff," SAMPLE_BITS = %d", &samplesize) == 1) { - lastwasinote=FALSE; continue; -- } else if (sscanf(scanbuff," SAMPLE_TYPE = %s", sampletype) == 1) { -+ } else if (sscanf(scanbuff, " SAMPLE_TYPE = " S(64), sampletype) == 1) { - lastwasinote=FALSE; continue; -- } else if (sscanf(scanbuff," SPACECRAFT_NAME = %s %s", -+ } else if (sscanf(scanbuff," SPACECRAFT_NAME = " S(COMMENTSIZE) " " S(1023), - spacecraft,garbage) == 2 ) { -- strcat(spacecraft,xv_strstr(scanbuff, spacecraft)+strlen(spacecraft)); -+ const char *tmp = xv_strstr(scanbuff, spacecraft) + strlen(spacecraft); -+ strncat(spacecraft, tmp, COMMENTSIZE - strlen(spacecraft)); - lastwasinote=FALSE; continue; -- } else if (sscanf(scanbuff," SPACECRAFT_NAME = %s", spacecraft) == 1) { -+ } else if (sscanf(scanbuff, " SPACECRAFT_NAME = " S(COMMENTSIZE), spacecraft) == 1) { - lastwasinote=FALSE; continue; - -- } else if (sscanf(scanbuff," TARGET_NAME = %s", target) == 1) { -+ } else if (sscanf(scanbuff, " TARGET_NAME = " S(COMMENTSIZE), target) == 1) { - lastwasinote=FALSE; continue; -- } else if (sscanf(scanbuff," TARGET_BODY = %s", target) == 1) { -+ } else if (sscanf(scanbuff, " TARGET_BODY = " S(COMMENTSIZE), target) == 1) { - lastwasinote=FALSE; continue; - -- } else if (sscanf(scanbuff," MISSION_PHASE_NAME = %s", mphase) == 1) { -+ } else if (sscanf(scanbuff, " MISSION_PHASE_NAME = " S(COMMENTSIZE), mphase) == 1) { - lastwasinote=FALSE; continue; -- } else if (sscanf(scanbuff," MISSION_PHASE = %s", mphase) == 1) { -+ } else if (sscanf(scanbuff, " MISSION_PHASE = " S(COMMENTSIZE), mphase) == 1) { - lastwasinote=FALSE; continue; - -- } else if (sscanf(scanbuff," INSTRUMENT_NAME = %s", iname) == 1) { -+ } else if (sscanf(scanbuff, " INSTRUMENT_NAME = " S(COMMENTSIZE), iname) == 1) { - lastwasinote=FALSE; continue; - -- } else if (sscanf(scanbuff," GAIN_MODE_ID = %s", gainmode) == 1) { -+ } else if (sscanf(scanbuff, " GAIN_MODE_ID = " S(COMMENTSIZE), gainmode) == 1) { - lastwasinote=FALSE; continue; - -- } else if (sscanf(scanbuff," INSTRUMENT_GAIN_STATE = %s",gainmode)==1) { -+ } else if (sscanf(scanbuff, " INSTRUMENT_GAIN_STATE = " S(COMMENTSIZE), gainmode) ==1 ) { - lastwasinote=FALSE; continue; - -- } else if (sscanf(scanbuff," EDIT_MODE_ID = %s", editmode) == 1) { -+ } else if (sscanf(scanbuff, " EDIT_MODE_ID = " S(COMMENTSIZE), editmode) == 1) { - lastwasinote=FALSE; continue; - -- } else if (sscanf(scanbuff," INSTRUMENT_EDIT_MODE = %s", editmode)==1) { -+ } else if (sscanf(scanbuff, " INSTRUMENT_EDIT_MODE = " S(COMMENTSIZE), editmode) == 1) { - lastwasinote=FALSE; continue; - -- } else if (sscanf(scanbuff," SCAN_MODE_ID = %s", scanmode) == 1) { -+ } else if (sscanf(scanbuff, " SCAN_MODE_ID = " S(COMMENTSIZE), scanmode) == 1) { - lastwasinote=FALSE; continue; - -- } else if (sscanf(scanbuff," INSTRUMENT_SCAN_RATE = %s", scanmode)==1) { -+ } else if (sscanf(scanbuff, " INSTRUMENT_SCAN_RATE = " S(COMMENTSIZE), scanmode) == 1) { - lastwasinote=FALSE; continue; - -- } else if (sscanf(scanbuff," SHUTTER_MODE_ID = %s", shuttermode) == 1) { -+ } else if (sscanf(scanbuff, " SHUTTER_MODE_ID = " S(COMMENTSIZE), shuttermode) == 1) { - lastwasinote=FALSE; continue; - -- } else if (sscanf(scanbuff," INSTRUMENT_SHUTTER_MODE = %s", -- shuttermode) == 1) { -+ } else if (sscanf(scanbuff, " INSTRUMENT_SHUTTER_MODE = " S(COMMENTSIZE), shuttermode) == 1) { - lastwasinote=FALSE; continue; - -- } else if (sscanf(scanbuff," SCAN_MODE_ID = %s", scanmode) == 1) { -+ } else if (sscanf(scanbuff, " SCAN_MODE_ID = " S(COMMENTSIZE), scanmode) == 1) { - lastwasinote=FALSE; continue; - -- } else if (sscanf(scanbuff," INSTRUMENT_SCAN_RATE = %s", scanmode)==1) { -+ } else if (sscanf(scanbuff, " INSTRUMENT_SCAN_RATE = " S(COMMENTSIZE), scanmode) == 1) { - lastwasinote=FALSE; continue; - -- } else if (sscanf(scanbuff," SPACECRAFT_EVENT_TIME = %s", itime) == 1) { -+ } else if (sscanf(scanbuff, " SPACECRAFT_EVENT_TIME = " S(COMMENTSIZE), itime) == 1) { - lastwasinote=FALSE; continue; - -- } else if (sscanf(scanbuff," IMAGE_TIME = %s", itime) == 1) { -+ } else if (sscanf(scanbuff, " IMAGE_TIME = " S(COMMENTSIZE), itime) == 1) { - lastwasinote=FALSE; continue; - -- } else if (sscanf(scanbuff," FILTER_NAME = %s", filtname) == 1) { -+ } else if (sscanf(scanbuff, " FILTER_NAME = " S(COMMENTSIZE), filtname) == 1) { - lastwasinote=FALSE; continue; - -- } else if (sscanf(scanbuff," INSTRUMENT_FILTER_NAME = %s",filtname)==1) { -+ } else if (sscanf(scanbuff, " INSTRUMENT_FILTER_NAME = " S(COMMENTSIZE), filtname) == 1) { - lastwasinote=FALSE; continue; - -- } else if ((sscanf(scanbuff," EXPOSURE_DURATION = %s", exposure) == 1) -- || (sscanf(scanbuff," INSTRUMENT_EXPOSURE_DURATION = %s", -- exposure) == 1)) { -+ } else if ((sscanf(scanbuff, " EXPOSURE_DURATION = " S(COMMENTSIZE), exposure) == 1) -+ || (sscanf(scanbuff, " INSTRUMENT_EXPOSURE_DURATION = " S(COMMENTSIZE), -+ exposure)) == 1) { - tmptmp = (char *) index(scanbuff,'='); - tmptmp++; - while((*tmptmp) == ' ') -@@ -520,10 +524,10 @@ - strcpy(exposure,tmptmp); - lastwasinote=FALSE; continue; - -- } else if (sscanf(scanbuff, "NOTE = %s", inote) == 1) { -+ } else if (sscanf(scanbuff, "NOTE = " S(INOTESIZE), inote) == 1) { - tmptmp = (char *) index(scanbuff,'='); tmptmp++; - while (((*tmptmp) == ' ') || ((*tmptmp) == '"')) tmptmp++; -- strcpy(inote,tmptmp); -+ strncpy(inote, tmptmp, INOTESIZE - 1); - strcat(inote," "); - - /* evil and somewhat risky: A "note" (really, any textual -@@ -548,7 +552,7 @@ - } else if (lastwasinote) { - tmptmp=scanbuff; - while (((*tmptmp) == ' ') || ((*tmptmp) == '"')) tmptmp++; -- strcat(inote,tmptmp); -+ strncat(inote, tmptmp, INOTESIZE - strlen(inote) - 1); - strcat(inote," "); - if (index(tmptmp,'"') != NULL) - lastwasinote=FALSE; -@@ -647,27 +651,27 @@ - - *infobuff='\0'; - if (*spacecraft) { -- strcat(infobuff,spacecraft); -+ strncat(infobuff, spacecraft, sizeof(infobuff) - 1); - } - - if (*target) { -- strcat(infobuff,", "); -- strcat(infobuff,target); -+ strncat(infobuff, ", ", sizeof(infobuff) - strlen(infobuff) - 1); -+ strncat(infobuff, target, sizeof(infobuff) - strlen(infobuff) - 1); - } - - if (*filtname) { -- strcat(infobuff,", "); -- strcat(infobuff,filtname); -+ strncat(infobuff, ", ", sizeof(infobuff) - strlen(infobuff) - 1); -+ strncat(infobuff, filtname, sizeof(infobuff) - strlen(infobuff) - 1); - } - - if (*itime) { -- strcat(infobuff,", "); -- strcat(infobuff,itime); -+ strncat(infobuff, ", ", sizeof(infobuff) - strlen(infobuff) - 1); -+ strncat(infobuff, itime, sizeof(infobuff) - strlen(infobuff) - 1); - } - -- SetISTR(ISTR_WARNING,infobuff); -+ SetISTR(ISTR_WARNING, "%s", infobuff); - -- strcpy(pdsuncompfname,fname); -+ strncpy(pdsuncompfname,fname,sizeof(pdsuncompfname) - 1); - ftypstr = ""; - - switch (itype) { -@@ -695,7 +699,7 @@ - fclose(zf); - - #ifndef VMS -- sprintf(pdsuncompfname,"%s/xvhuffXXXXXX", tmpdir); -+ snprintf(pdsuncompfname, sizeof(pdsuncompfname) - 1, "%s/xvhuffXXXXXX", tmpdir); - #else - strcpy(pdsuncompfname,"sys$disk:[]xvhuffXXXXXX"); - #endif -@@ -707,7 +711,7 @@ - #endif - - #ifndef VMS -- sprintf(scanbuff,"%s %s - 4 >%s",PDSUNCOMP,fname,pdsuncompfname); -+ sprintf(scanbuff,"%s '%s' - 4 > %s", PDSUNCOMP, fname, pdsuncompfname); - #else - sprintf(scanbuff,"%s %s %s 4",PDSUNCOMP,fname,pdsuncompfname); - #endif -@@ -823,26 +827,26 @@ - char tmp[256]; - *(pinfo->comment) = '\0'; - -- sprintf(tmp, "Spacecraft: %-28sTarget: %-32s\n", spacecraft, target); -- strcat(pinfo->comment, tmp); -+ sprintf(tmp, "Spacecraft: %-28.28sTarget: %-32.32s\n", spacecraft, target); -+ strncat(pinfo->comment, tmp, 2000 - strlen(pinfo->comment) - 1); - -- sprintf(tmp, "Filter: %-32sMission phase: %-24s\n", filtname, mphase); -- strcat(pinfo->comment, tmp); -+ sprintf(tmp, "Filter: %-32.32sMission phase: %-24.24s\n", filtname, mphase); -+ strncat(pinfo->comment, tmp, 2000 - strlen(pinfo->comment) - 1); - -- sprintf(tmp, "Image time: %-28sGain mode: %-29s\n", itime, gainmode); -- strcat(pinfo->comment, tmp); -+ sprintf(tmp, "Image time: %-28.28sGain mode: %-29.29s\n", itime, gainmode); -+ strncat(pinfo->comment, tmp, 2000 - strlen(pinfo->comment) - 1); - -- sprintf(tmp, "Edit mode: %-29sScan mode: %-29s\n", editmode, scanmode); -- strcat(pinfo->comment, tmp); -+ sprintf(tmp, "Edit mode: %-29.29sScan mode: %-29.29s\n", editmode, scanmode); -+ strncat(pinfo->comment, tmp, 2000 - strlen(pinfo->comment) - 1); - -- sprintf(tmp, "Exposure: %-30sShutter mode: %-25s\n", exposure,shuttermode); -- strcat(pinfo->comment, tmp); -+ sprintf(tmp, "Exposure: %-30.30sShutter mode: %-25.25s\n", exposure,shuttermode); -+ strncat(pinfo->comment, tmp, 2000 - strlen(pinfo->comment) - 1); - -- sprintf(tmp, "Instrument: %-28sImage time: %-28s\n", iname, itime); -- strcat(pinfo->comment, tmp); -+ sprintf(tmp, "Instrument: %-28.28sImage time: %-28.28s\n", iname, itime); -+ strncat(pinfo->comment, tmp, 2000 - strlen(pinfo->comment) - 1); - -- sprintf(tmp, "Image Note: %-28s", inote); -- strcat(pinfo->comment, tmp); -+ sprintf(tmp, "Image Note: %-28.28s", inote); -+ strncat(pinfo->comment, tmp, 2000 - strlen(pinfo->comment) - 1); - } - - if (LoadPDSPalette(fname, pinfo)) return 1; ---- xvps.c -+++ xvps.c Wed Apr 13 15:01:24 2005 -@@ -1561,7 +1561,8 @@ - the first one is loaded (but not deleted) */ - - #ifdef GS_PATH -- char tmp[512], gscmd[512], cmdstr[512], tmpname[64]; -+ #define CMDSIZE 1024 -+ char tmp[512], gscmd[512], cmdstr[CMDSIZE], tmpname[64]; - int gsresult, nump, i, filetype, doalert, epsf; - #endif - -@@ -1733,32 +1734,48 @@ - - /******************************************************************/ - #ifdef GS_PATH --void buildCmdStr(str, gscmd, fname, quick, epsf) -- char *str, *gscmd, *fname; -+void buildCmdStr(str, gscmd, xname, quick, epsf) -+ char *str, *gscmd, *xname; - int quick, epsf; - { - /* note 'epsf' set only on files that don't have a showpage cmd */ -+ char *x, *y, *fname; -+ -+ x = (char *) malloc((5 * strlen(xname))+3); -+ if (!x) -+ FatalError("malloc failure in xvps.c buildCmdStr"); -+ fname = x; -+ *x++ = 0x27; -+ -+ for (y = xname; *y; ++y) { -+ if (0x27 == *y) { -+ strcpy(x, "'\"'\"'"); -+ x += strlen(x); -+ } else *x++ = *y; -+ } -+ strcpy (x, "'"); - - #ifndef VMS - -- if (epsf) sprintf(str, "echo '\n showpage ' | cat '%s' - | %s -", -+ if (epsf) snprintf(str, CMDSIZE, "echo '\n showpage ' | cat %s - | %s -", - fname, gscmd); - -- else if (quick) sprintf(str, "echo '%s' | cat - '%s' | %s -", -+ else if (quick) snprintf(str, CMDSIZE, "echo %s | cat - %s | %s -", - "/showpage { showpage quit } bind def", - fname, gscmd); - -- else sprintf(str, "%s -- %s", gscmd, fname); -+ else snprintf(str, CMDSIZE, "%s -- %s", gscmd, fname); - - #else /* VMS */ - /* VMS doesn't have pipes or an 'echo' command and GS doesn't like -- Unix-style file names as input files in the VMS version */ -+ Unix-style file fnames as input files in the VMS version */ - strcat(tmp, " -- "); - rld = strrchr(fname, '/'); /* Pointer to last '/' */ - if (rld) rld++; /* Pointer to filename */ - else rld = fname; /* No path - use original string */ - strcat(tmp, rld); - #endif /* VMS */ -+ free(fname); - } - #endif /* GS_PATH */ - ---- xvtiff.c -+++ xvtiff.c Wed Apr 13 15:01:24 2005 -@@ -512,7 +512,7 @@ - vsprintf(cp, fmt, ap); - strcat(cp, "."); - -- SetISTR(ISTR_WARNING,buf); -+ SetISTR(ISTR_WARNING, "%s", buf); - - error_occurred = 1; - } -@@ -536,7 +536,7 @@ - vsprintf(cp, fmt, ap); - strcat(cp, "."); - -- SetISTR(ISTR_WARNING,buf); -+ SetISTR(ISTR_WARNING, "%s", buf); - } - - diff --git a/media-gfx/xv/files/xv-filename-format-string.diff b/media-gfx/xv/files/xv-filename-format-string.diff deleted file mode 100644 index 9cc4870c0ec1..000000000000 --- a/media-gfx/xv/files/xv-filename-format-string.diff +++ /dev/null @@ -1,11 +0,0 @@ ---- xv.c 2005-03-01 15:20:50.153871368 +0000 -+++ xv.c 2005-03-01 15:20:39.241530296 +0000 -@@ -2249,7 +2249,7 @@ - SetISTR(ISTR_INFO,formatStr); - - SetInfoMode(INF_PART); -- SetISTR(ISTR_FILENAME, -+ SetISTR(ISTR_FILENAME, "%s", - (filenum==DFLTPIC || filenum==GRABBED || frompipe) - ? "<none>" : basefname); - diff --git a/media-gfx/xv/files/xv-optimize-jpeg.diff b/media-gfx/xv/files/xv-optimize-jpeg.diff deleted file mode 100644 index bcd1879f6fba..000000000000 --- a/media-gfx/xv/files/xv-optimize-jpeg.diff +++ /dev/null @@ -1,18 +0,0 @@ ---- xvjpeg.c.orig 2005-01-04 13:49:48.074362760 +0000 -+++ xvjpeg.c 2005-01-04 13:51:04.286776712 +0000 -@@ -761,6 +761,7 @@ - jpeg_set_defaults(&cinfo); - jpeg_set_quality(&cinfo, (int)qDial.val, TRUE); - cinfo.smoothing_factor = (int)smDial.val; -+ cinfo.optimize_coding = TRUE; - - - jpeg_start_compress(&cinfo, TRUE); ---- jpeg/jconfig.cfg.orig 1994-12-22 22:35:00.000000000 +0000 -+++ jpeg/jconfig.cfg 2005-01-04 13:51:04.285776864 +0000 -@@ -42,3 +42,5 @@ - #undef PROGRESS_REPORT - - #endif /* JPEG_CJPEG_DJPEG */ -+ -+#define JDCT_DEFAULT JDCT_FLOAT diff --git a/media-gfx/xv/files/xv-postscript-double-free.diff b/media-gfx/xv/files/xv-postscript-double-free.diff deleted file mode 100644 index 740dafcb65e7..000000000000 --- a/media-gfx/xv/files/xv-postscript-double-free.diff +++ /dev/null @@ -1,30 +0,0 @@ ---- xv-3.10a/xvps.c Thu Dec 22 14:12:17 1994 -+++ xv-3.10a/xvps.c Sun Nov 30 22:55:21 1997 -@@ -891,7 +891,7 @@ - int i, j, q, err, rpix, gpix, bpix, nc, ptype; - int iw, ih, ox, oy, slen, lwidth, bits, colorps, w, h, pfree; - double iwf, ihf; -- byte *inpix, *rmap, *gmap, *bmap; -+ byte *save_inpix, *inpix, *rmap, *gmap, *bmap; - - slen = bits = colorps = 0; - -@@ -901,7 +901,8 @@ - - WaitCursor(); - -- inpix = GenSavePic(&ptype, &w, &h, &pfree, &nc, &rmap, &gmap, &bmap); -+ save_inpix = inpix = -+ GenSavePic(&ptype, &w, &h, &pfree, &nc, &rmap, &gmap, &bmap); - - - /* printed image will have size iw,ih (in picas) */ -@@ -1123,7 +1124,7 @@ - fprintf(fp,"origstate restore\n\n"); - fprintf(fp,"%%%%Trailer\n"); - -- if (pfree) free(inpix); -+ if (pfree) free(save_inpix); - - if (CloseOutFile(fp, filename, (err==EOF)) == 0) { - DirBox(0); diff --git a/media-gfx/xv/files/xv-smoothing-algorithm.diff b/media-gfx/xv/files/xv-smoothing-algorithm.diff deleted file mode 100644 index e5516966a5eb..000000000000 --- a/media-gfx/xv/files/xv-smoothing-algorithm.diff +++ /dev/null @@ -1,172 +0,0 @@ -diff -urN old/xv-3.10a/xvsmooth.c xv-3.10a/xvsmooth.c ---- old/xv-3.10a/xvsmooth.c Thu Dec 22 17:34:42 1994 -+++ xv-3.10a/xvsmooth.c Sun Aug 17 14:07:58 1997 -@@ -65,10 +65,13 @@ - returns a dwide*dhigh 24bit image, or NULL on failure (malloc) */ - /* rmap,gmap,bmap should be 'desired' colors */ - -+ /* DANGER: This code assumes that a right-shift on signed integers is -+ performed arithmetically, i.e. the sign bit is copied to the right. */ -+ - byte *pic24, *pp; -- int *cxtab, *pxtab; -- int y1Off, cyOff; -- int ex, ey, cx, cy, px, py, apx, apy, x1, y1; -+ int *pxtab; -+ int ex, ey, px, py, x0, x1, y0, y1; -+ int y0off, y1off; - int cA, cB, cC, cD; - int pA, pB, pC, pD; - int retval, bperpix; -@@ -98,69 +101,61 @@ - else { - /* dwide >= swide && dhigh >= shigh */ - -- /* cx,cy = original pixel in pic824. px,py = relative position -- of pixel ex,ey inside of cx,cy as percentages +-50%, +-50%. -- 0,0 = middle of pixel */ -- -- /* we can save a lot of time by precomputing cxtab[] and pxtab[], both -- dwide arrays of ints that contain values for the equations: -- cx = (ex * swide) / dwide; -- px = ((ex * swide * 100) / dwide) - (cx * 100) - 50; */ -- -- cxtab = (int *) malloc(dwide * sizeof(int)); -- if (!cxtab) { free(pic24); return NULL; } -+ /* px, py = location on original image, in units of 1/256 pixel -+ We can save time by precomputing all values of px. */ - - pxtab = (int *) malloc(dwide * sizeof(int)); -- if (!pxtab) { free(pic24); free(cxtab); return NULL; } -- -- for (ex=0; ex<dwide; ex++) { -- cxtab[ex] = (ex * swide) / dwide; -- pxtab[ex] = (((ex * swide)* 100) / dwide) -- - (cxtab[ex] * 100) - 50; -- } -+ if (!pxtab) { free(pic24); return NULL; } - -- for (ey=0; ey<dhigh; ey++) { -+ for (ex=0; ex < dwide; ex++) -+ pxtab[ex] = ((ex << 8) + 128) * swide / dwide - 128; -+ -+ for (ey=0; ey < dhigh; ey++) { - byte *pptr, rA, gA, bA, rB, gB, bB, rC, gC, bC, rD, gD, bD; - - ProgressMeter(0, (dhigh)-1, ey, "Smooth"); - -- cy = (ey * shigh) / dhigh; -- py = (((ey * shigh) * 100) / dhigh) - (cy * 100) - 50; -- if (py<0) { y1 = cy-1; if (y1<0) y1=0; } -- else { y1 = cy+1; if (y1>shigh-1) y1=shigh-1; } -+ py = ((ey << 8) + 128) * shigh / dhigh - 128; -+ y0 = py >> 8; /* Put integer part in y0 */ -+ y1 = y0 + 1; -+ py &= 255; /* Keep fractional part in py */ -+ -+ if (y0 < 0) y0 = y1 = 0; -+ if (y1 >= shigh) y0 = y1 = shigh-1; - -- cyOff = cy * swide * bperpix; /* current line */ -- y1Off = y1 * swide * bperpix; /* up or down one line, depending */ -+ y0off = y0 * swide * bperpix; /* current line */ -+ y1off = y1 * swide * bperpix; /* one line down */ - - if ((ey&15) == 0) WaitCursor(); - -- for (ex=0; ex<dwide; ex++) { -- rA = rB = rC = rD = gA = gB = gC = gD = bA = bB = bC = bD = 0; -+ for (ex=0; ex < dwide; ex++) { - -- cx = cxtab[ex]; - px = pxtab[ex]; -+ x0 = px >> 8; /* Put integer part in x0 */ -+ x1 = x0 + 1; -+ px &= 255; /* Keep fractional part in px */ - -- if (px<0) { x1 = cx-1; if (x1<0) x1=0; } -- else { x1 = cx+1; if (x1>swide-1) x1=swide-1; } -+ if (x0 < 0) x0 = x1 = 0; -+ if (x1 >= swide) x0 = x1 = swide-1; - - if (is24) { -- pptr = pic824 + y1Off + x1*bperpix; /* corner pixel */ -+ pptr = pic824 + y0off + x0*bperpix; /* upper left pixel */ - rA = *pptr++; gA = *pptr++; bA = *pptr++; - -- pptr = pic824 + y1Off + cx*bperpix; /* up/down center pixel */ -+ pptr = pic824 + y0off + x1*bperpix; /* upper right pixel */ - rB = *pptr++; gB = *pptr++; bB = *pptr++; - -- pptr = pic824 + cyOff + x1*bperpix; /* left/right center pixel */ -+ pptr = pic824 + y1off + x0*bperpix; /* lower left pixel */ - rC = *pptr++; gC = *pptr++; bC = *pptr++; - -- pptr = pic824 + cyOff + cx*bperpix; /* center pixel */ -+ pptr = pic824 + y1off + x1*bperpix; /* lower right pixel */ - rD = *pptr++; gD = *pptr++; bD = *pptr++; - } - else { /* 8-bit picture */ -- cA = pic824[y1Off + x1]; /* corner pixel */ -- cB = pic824[y1Off + cx]; /* up/down center pixel */ -- cC = pic824[cyOff + x1]; /* left/right center pixel */ -- cD = pic824[cyOff + cx]; /* center pixel */ -+ cA = pic824[y0off + x0]; /* upper left pixel */ -+ cB = pic824[y0off + x1]; /* upper right pixel */ -+ cC = pic824[y1off + x0]; /* lower left pixel */ -+ cD = pic824[y1off + x1]; /* lower right pixel */ - } - - /* quick check */ -@@ -170,38 +165,30 @@ - } - - else { -- /* compute weighting factors */ -- apx = abs(px); apy = abs(py); -- pA = (apx * apy) / 100; -- pB = (apy * (100 - apx)) / 100; -- pC = (apx * (100 - apy)) / 100; -- pD = 100 - (pA + pB + pC); -+ pA = (256-px)*(256-py); /* compute weighting factors */ -+ pB = px * (256-py); /* total weight is exactly 2^16 */ -+ pC = (256-px) * py; -+ pD = px * py; - - if (is24) { -- *pp++ = ((int) (pA * rA))/100 + ((int) (pB * rB))/100 + -- ((int) (pC * rC))/100 + ((int) (pD * rD))/100; -- -- *pp++ = ((int) (pA * gA))/100 + ((int) (pB * gB))/100 + -- ((int) (pC * gC))/100 + ((int) (pD * gD))/100; -- -- *pp++ = ((int) (pA * bA))/100 + ((int) (pB * bB))/100 + -- ((int) (pC * bC))/100 + ((int) (pD * bD))/100; -+ *pp++ = (pA * rA + pB * rB + pC * rC + pD * rD) + 32768 >> 16; -+ *pp++ = (pA * gA + pB * gB + pC * gC + pD * gD) + 32768 >> 16; -+ *pp++ = (pA * bA + pB * bB + pC * bC + pD * bD) + 32768 >> 16; - } - else { /* 8-bit pic */ -- *pp++ = ((int) (pA * rmap[cA]))/100 + ((int)(pB * rmap[cB]))/100 + -- ((int) (pC * rmap[cC]))/100 + ((int)(pD * rmap[cD]))/100; -+ *pp++ = (pA * rmap[cA] + pB * rmap[cB] + pC * rmap[cC] + -+ pD * rmap[cD]) + 32768 >> 16; - -- *pp++ = ((int) (pA * gmap[cA]))/100 + ((int)(pB * gmap[cB]))/100 + -- ((int) (pC * gmap[cC]))/100 + ((int)(pD * gmap[cD]))/100; -+ *pp++ = (pA * gmap[cA] + pB * gmap[cB] + pC * gmap[cC] + -+ pD * gmap[cD]) + 32768 >> 16; - -- *pp++ = ((int)(pA * bmap[cA]))/100 + ((int)(pB * bmap[cB]))/100 + -- ((int)(pC * bmap[cC]))/100 + ((int)(pD * bmap[cD]))/100; -+ *pp++ = (pA * bmap[cA] + pB * bmap[cB] + pC * bmap[cC] + -+ pD * bmap[cD]) + 32768 >> 16; - } - } - } - } - -- free(cxtab); - free(pxtab); - retval = 0; /* okay */ - } diff --git a/media-gfx/xv/files/xv-use-getcwd.patch b/media-gfx/xv/files/xv-use-getcwd.patch deleted file mode 100644 index 23c13f39fd83..000000000000 --- a/media-gfx/xv/files/xv-use-getcwd.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- xv.h.old 2004-04-17 11:43:18.221960440 +0100 -+++ xv.h 2004-04-17 11:43:30.290125800 +0100 -@@ -66,6 +66,7 @@ - # ifndef _LINUX_LIMITS_H - # include <linux/limits.h> - # endif -+# define USE_GETCWD - #endif - - |