summaryrefslogtreecommitdiffstats
path: root/graphics
diff options
context:
space:
mode:
authorroam <roam@FreeBSD.org>2006-10-05 12:34:43 +0000
committerroam <roam@FreeBSD.org>2006-10-05 12:34:43 +0000
commit435f44e87956536a60f2e4ed0beb580ff42096eb (patch)
tree47988fe2bd50dcc5a6c28d37427ec0c745318e44 /graphics
parentaa77fcbce1b6a9de728c2055f88058dec2bda253 (diff)
downloadFreeBSD-ports-435f44e87956536a60f2e4ed0beb580ff42096eb.zip
FreeBSD-ports-435f44e87956536a60f2e4ed0beb580ff42096eb.tar.gz
Add a patch to the JPEG processing to fix the latest security
vulnerability and remove the FORBIDDEN and DEPRECATED tags. Obtained from: http://bugs.debian.org/362288 Silence from: maintainer
Diffstat (limited to 'graphics')
-rw-r--r--graphics/xzgv/Makefile6
-rw-r--r--graphics/xzgv/files/patch-src-readjpeg.c80
2 files changed, 81 insertions, 5 deletions
diff --git a/graphics/xzgv/Makefile b/graphics/xzgv/Makefile
index 25a8158..62f8de7 100644
--- a/graphics/xzgv/Makefile
+++ b/graphics/xzgv/Makefile
@@ -7,7 +7,7 @@
PORTNAME= xzgv
PORTVERSION= 0.8
-PORTREVISION= 3
+PORTREVISION= 4
CATEGORIES= graphics
MASTER_SITES= ${MASTER_SITE_SUNSITE}
MASTER_SITE_SUBDIR= apps/graphics/viewers/X
@@ -15,10 +15,6 @@ MASTER_SITE_SUBDIR= apps/graphics/viewers/X
MAINTAINER= nosuzuki@postcard.st
COMMENT= An image viewer with thumbnail-based file selector for X
-FORBIDDEN= http://vuxml.freebsd.org/a813a219-d2d4-11da-a672-000e0c2e438a.html
-DEPRECATED= ${FORBIDDEN}
-EXPIRATION_DATE=2006-12-01
-
USE_X_PREFIX= yes
USE_GNOME= imlib
USE_GMAKE= yes
diff --git a/graphics/xzgv/files/patch-src-readjpeg.c b/graphics/xzgv/files/patch-src-readjpeg.c
new file mode 100644
index 0000000..b5457ac
--- /dev/null
+++ b/graphics/xzgv/files/patch-src-readjpeg.c
@@ -0,0 +1,80 @@
+--- src/readjpeg.c Tue Mar 21 12:16:07 2006
++++ src/readjpeg.c Wed Sep 21 21:15:01 2005
+@@ -179,11 +179,13 @@
+ static int have_image;
+ static int width,height;
+ static unsigned char *image;
++static int cmyk;
+ unsigned char *ptr,*ptr2;
+ int chkw,chkh;
+ int f,rec;
+ static int greyscale; /* static to satisfy gcc -Wall */
+
++cmyk=0;
+ greyscale=0;
+
+ lineptrs=NULL;
+@@ -225,6 +227,15 @@
+ greyscale=1;
+ }
+
++if(cinfo.jpeg_color_space==JCS_CMYK)
++ cmyk=1;
++
++if(cinfo.jpeg_color_space==JCS_YCCK)
++ {
++ cmyk=1;
++ cinfo.out_color_space=JCS_CMYK;
++ }
++
+ *wp=width=cinfo.image_width;
+ *hp=height=cinfo.image_height;
+
+@@ -266,7 +277,7 @@
+ /* this one shouldn't hurt */
+ cinfo.do_block_smoothing=FALSE;
+
+-if(WH_BAD(width,height) || (*imagep=image=malloc(width*height*3))==NULL)
++if(WH_BAD(width,height) || (*imagep=image=malloc(width*(height+cmyk)*3))==NULL)
+ longjmp(jerr.setjmp_buffer,1);
+
+ jpeg_start_decompress(&cinfo);
+@@ -279,12 +290,33 @@
+ for(f=0;f<height;f++,ptr+=width*3)
+ lineptrs[f]=ptr;
+
+-rec=cinfo.rec_outbuf_height;
+-while(cinfo.output_scanline<height)
++if(!cmyk)
+ {
+- f=height-cinfo.output_scanline;
+- jpeg_read_scanlines(&cinfo,lineptrs+cinfo.output_scanline,
+- f>rec?rec:f);
++ rec=cinfo.rec_outbuf_height;
++ while(cinfo.output_scanline<height)
++ {
++ f=height-cinfo.output_scanline;
++ jpeg_read_scanlines(&cinfo,lineptrs+cinfo.output_scanline,
++ f>rec?rec:f);
++ }
++ }
++else /* cmyk output */
++ {
++ int tmp;
++
++ ptr=image;
++ while(cinfo.output_scanline<height)
++ {
++ jpeg_read_scanlines(&cinfo,&ptr,1);
++ ptr2=ptr;
++ for(f=0;f<width;f++,ptr+=3,ptr2+=4)
++ {
++ tmp=ptr2[3];
++ ptr[0]=(tmp*ptr2[0])/255;
++ ptr[1]=(tmp*ptr2[1])/255;
++ ptr[2]=(tmp*ptr2[2])/255;
++ }
++ }
+ }
+
+ free(lineptrs);
OpenPOWER on IntegriCloud