# HG changeset patch # User holger # Date 1265925912 -3600 # Node ID 085b6c4656629324441ff0a314731c315a84f962 # Parent 148a6b1dbe47c175abb0eeb70a6094e7a8f70899 bump graphicsmagick to 1.3.10 diff -r 148a6b1dbe47 -r 085b6c465662 media-gfx/graphicsmagick/Manifest --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/media-gfx/graphicsmagick/Manifest Thu Feb 11 23:05:12 2010 +0100 @@ -0,0 +1,7 @@ +AUX graphicsmagick-1.3.7-CVE-2009-1882.patch 19819 RMD160 2f011c693e18233354ea5d3e1cf7b5e639f08996 SHA1 8b61f70bbe3e6aadc6ec61e7765a2cb12918ee05 SHA256 e0a64d87ebdabedb6df39a97df31f96792a10464c16d432cc10cf8503fd6a260 +AUX graphicsmagick-1.3.7-CVE-2009-3736.patch 702 RMD160 1501640ef81023b93672eea2ff4c25c1f65abe22 SHA1 93274cac801e1e76bd2406d48d220c8244296e1d SHA256 f55c8ce74c05500432b7c65a1ec66b5c0e405b79264534c6c6b4353879b628c6 +AUX graphicsmagick-1.3.7-debian-fixed.patch 14493 RMD160 cbeccbd775d60da7f2b498540fdef8b08189eeb6 SHA1 2da7acdf46401cbc294170919c592cb842ab2afa SHA256 da17fbb6e30ca42b2d07871cc730de8f5ad61df9387cf22948fe1dcb72263b8c +AUX graphicsmagick-1.3.7-perl-ldflags.patch 991 RMD160 e234224a939892f04a82b83e48ef475318183b28 SHA1 5e5c89d808bd3040945c64a60e1f8df35c03053d SHA256 f1ff9bf3009b1e353089ed27067bee2895b4e7f0d9e15100abdebac20bef8644 +DIST GraphicsMagick-1.3.10.tar.bz2 6754130 RMD160 1f2dadea29ceb549a398a4017b9f4979e18e3a7a SHA1 f44743a1aeb06c42edd8502ca8369c7282414d4c SHA256 89b0195e6c0634fd10c7a0a5799baca1e34351fed0dec9c021b6eb46f7b41ae2 +EBUILD graphicsmagick-1.3.10.ebuild 3383 RMD160 6414a7a040f8358a7e3ce3355a391c13a8c0e9f4 SHA1 ad2c7190be26a76ad89e34c519388316f1d2928c SHA256 2ba994e09e6e3437cfea25f13d45263e815e86d99076d65204523b1d8015ad78 +MISC metadata.xml 979 RMD160 0a2a8648f7f56281f4db1f845c37865b3cbb64df SHA1 5ddee256c96236652983e56ed0a991e09b9b6c7e SHA256 73b9a3ba1b91780cdfbe20744ad4101170ad271d6df529621406382f59cbf29f diff -r 148a6b1dbe47 -r 085b6c465662 media-gfx/graphicsmagick/files/graphicsmagick-1.3.7-CVE-2009-1882.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/media-gfx/graphicsmagick/files/graphicsmagick-1.3.7-CVE-2009-1882.patch Thu Feb 11 23:05:12 2010 +0100 @@ -0,0 +1,482 @@ +--- GraphicsMagick/magick/xwindow.c 2009/09/16 02:13:01 1.230 ++++ GraphicsMagick/magick/xwindow.c 2009/10/10 17:55:17 1.232 +@@ -43,10 +43,12 @@ + #include "magick/describe.h" + #include "magick/log.h" + #include "magick/magick.h" ++#include "magick/monitor.h" + #include "magick/pixel_cache.h" + #include "magick/resize.h" + #include "magick/shear.h" + #include "magick/tempfile.h" ++#include "magick/texture.h" + #include "magick/transform.h" + #include "magick/utility.h" + #include "magick/version.h" +@@ -2937,7 +2939,7 @@ MagickExport void MagickXGetImportInfo(M + % % + % % + % % +-% M a g i c k X G e t P i x e l I n f o % ++% M a g i c k X G e t P i x e l P a c k e t % + % % + % % + % % +@@ -5350,8 +5352,8 @@ MagickExport Cursor MagickXMakeCursor(Di + % The format of the MagickXMakeImage method is: + % + % unsigned int MagickXMakeImage(Display *display, +-% const MagickXResourceInfo *resource_info,MagickXWindowInfo *window,Image *image, +-% unsigned int width,unsigned int height) ++% const MagickXResourceInfo *resource_info,MagickXWindowInfo *window, ++% Image *image,unsigned int width,unsigned int height) + % + % A description of each parameter follows: + % +@@ -5376,9 +5378,49 @@ MagickExport Cursor MagickXMakeCursor(Di + % + % + */ +-MagickExport unsigned int MagickXMakeImage(Display *display, +- const MagickXResourceInfo *resource_info,MagickXWindowInfo *window,Image *image, +- unsigned int width,unsigned int height) ++static const char * ++MagickXImageFormatToString(int xformat) ++{ ++ static const char ++ *formats[] = ++ { ++ "XYBitmap", ++ "XYPixmap", ++ "ZPixmap" ++ }; ++ ++ const char ++ *format = "Unknown"; ++ ++ if ((size_t) xformat < sizeof(formats)/sizeof(formats[0])) ++ format=formats[xformat]; ++ ++ return format; ++} ++static const char * ++MagickXByteOrderToString(int xbyte_order) ++{ ++ static const char ++ *byte_orders[] = ++ { ++ "LSBFirst", ++ "MSBFirst" ++ }; ++ ++ const char ++ *byte_order = "Unknown"; ++ ++ if ((size_t) xbyte_order < sizeof(byte_orders)/sizeof(byte_orders[0])) ++ byte_order=byte_orders[xbyte_order]; ++ ++ return byte_order; ++} ++MagickExport unsigned int ++MagickXMakeImage(Display *display, ++ const MagickXResourceInfo *resource_info, ++ MagickXWindowInfo *window, ++ Image *image, ++ unsigned int width,unsigned int height) + { + int + depth, +@@ -5410,6 +5452,10 @@ MagickExport unsigned int MagickXMakeIma + window->destroy=False; + if (window->image != (Image *) NULL) + { ++ MonitorHandler ++ handler=(MonitorHandler) NULL; ++ ++ handler=SetMonitorHandler((MonitorHandler) NULL); + if (window->crop_geometry) + { + Image +@@ -5459,44 +5505,49 @@ MagickExport unsigned int MagickXMakeIma + window->destroy=MagickTrue; + } + } +-#if 0 +- if ((window->immutable == MagickFalse) && +- (window->image->matte != MagickFalse) && +- (window->pixel_info->colors == 0)) ++ if ((window->image->matte != MagickFalse) && ++ (window->pixel_info->colors == 0) ++ /* && (window->immutable == MagickFalse) */) + { + Image + *texture; + + /* +- Tile background with texture. ++ Tile background with texture according to opacity + */ +- strlcpy(resource_info->image_info->filename,"image:checkerboard",MaxTextExtent); ++ strlcpy(resource_info->image_info->filename,"image:checkerboard", ++ sizeof(resource_info->image_info->filename)); + texture=ReadImage(resource_info->image_info,&window->image->exception); + if (texture != (Image *) NULL) + { + Image + *textured_image; + +- textured_image=CloneImage(window->image,window->image->columns, +- window->image->rows,MagickTrue,&window->image->exception); ++ textured_image=CloneImage(window->image,0,0,MagickTrue, ++ &window->image->exception); + if (textured_image != (Image *) NULL) + { +-/* strlcpy(window->image->filename,"textured_image.miff", MaxTextExtent); */ +-/* WriteImage(resource_info->image_info,window->image); */ +- TextureImage(textured_image,texture); +- textured_image->matte=MagickFalse; +- if (window->image != image) +- DestroyImage(window->image); +- window->image=textured_image; +- window->destroy=MagickTrue; ++ if (TextureImage(textured_image,texture) != MagickFail) ++ { ++ if (window->image != image) ++ DestroyImage(window->image); ++ window->image=textured_image; ++ window->destroy=MagickTrue; ++ } ++ else ++ { ++ DestroyImage(textured_image); ++ } + } + DestroyImage(texture); + texture=(Image *) NULL; + } + } +-#endif + width=(unsigned int) window->image->columns; ++ assert(width == window->image->columns); + height=(unsigned int) window->image->rows; ++ assert(height == window->image->rows); ++ (void) SetMonitorHandler(handler); + } + /* + Create X image. +@@ -5504,27 +5555,32 @@ MagickExport unsigned int MagickXMakeIma + ximage=(XImage *) NULL; + format=(depth == 1) ? XYBitmap : ZPixmap; + #if defined(HasSharedMemory) +- window->shared_memory&=XShmQueryExtension(display); ++ window->shared_memory &= XShmQueryExtension(display); + if (window->shared_memory) + { + XShmSegmentInfo + *segment_info; + ++ size_t ++ shm_extent; ++ + segment_info=(XShmSegmentInfo *) window->segment_info; + segment_info[1].shmid=(-1); + segment_info[1].shmaddr=NULL; + ximage=XShmCreateImage(display,window->visual,depth,format,(char *) NULL, +- &segment_info[1],width,height); +- window->shared_memory&=(ximage != (XImage *) NULL); ++ &segment_info[1],width,height); ++ window->shared_memory &= (ximage != (XImage *) NULL); ++ ++ shm_extent=MagickArraySize(ximage->height,ximage->bytes_per_line); ++ window->shared_memory &= (shm_extent != 0); + + if (window->shared_memory) +- segment_info[1].shmid=shmget(IPC_PRIVATE,(size_t) +- (ximage->bytes_per_line*ximage->height),IPC_CREAT | 0777); +- window->shared_memory&=(segment_info[1].shmid >= 0); ++ segment_info[1].shmid=shmget(IPC_PRIVATE,shm_extent,IPC_CREAT | 0777); ++ window->shared_memory &= (segment_info[1].shmid >= 0); + + if (window->shared_memory) + segment_info[1].shmaddr=(char *) MagickShmAt(segment_info[1].shmid,0,0); +- window->shared_memory&=(segment_info[1].shmaddr != NULL); ++ window->shared_memory &= (segment_info[1].shmaddr != NULL); + + if (!window->shared_memory) + { +@@ -5607,12 +5663,12 @@ MagickExport unsigned int MagickXMakeIma + if (IsEventLogging()) + { + (void) LogMagickEvent(X11Event,GetMagickModule(),"XImage:"); +- (void) LogMagickEvent(X11Event,GetMagickModule()," width, height: %dx%d", ++ (void) LogMagickEvent(X11Event,GetMagickModule()," width x height: %dx%d", + ximage->width,ximage->height); +- (void) LogMagickEvent(X11Event,GetMagickModule()," format: %d", +- ximage->format); +- (void) LogMagickEvent(X11Event,GetMagickModule()," byte order: %d", +- ximage->byte_order); ++ (void) LogMagickEvent(X11Event,GetMagickModule()," format: %s", ++ MagickXImageFormatToString(ximage->format)); ++ (void) LogMagickEvent(X11Event,GetMagickModule()," byte order: %s", ++ MagickXByteOrderToString(ximage->byte_order)); + (void) LogMagickEvent(X11Event,GetMagickModule(), + " bitmap unit, bit order, pad: %d %d %d",ximage->bitmap_unit, + ximage->bitmap_bit_order,ximage->bitmap_pad); +@@ -5629,11 +5685,13 @@ MagickExport unsigned int MagickXMakeIma + if (!window->shared_memory) + { + if (ximage->format == XYBitmap) +- ximage->data=MagickAllocateArray(char *, +- ximage->height*ximage->depth,ximage->bytes_per_line); ++ ximage->data= ++ MagickAllocateArray(char *, ++ MagickArraySize(ximage->height,ximage->bytes_per_line), ++ ximage->depth); + else +- ximage->data=MagickAllocateArray(char *, +- ximage->height,ximage->bytes_per_line); ++ ximage->data= ++ MagickAllocateArray(char *,ximage->height,ximage->bytes_per_line); + } + if (ximage->data == (char *) NULL) + { +@@ -5709,8 +5767,9 @@ MagickExport unsigned int MagickXMakeIma + /* + Allocate matte image pixel data. + */ +- length=matte_image->bytes_per_line* +- matte_image->height*matte_image->depth; ++ length=MagickArraySize(MagickArraySize(matte_image->bytes_per_line, ++ matte_image->height), ++ matte_image->depth); + matte_image->data=MagickAllocateMemory(char *,length); + if (matte_image->data == (char *) NULL) + { +@@ -7371,9 +7430,9 @@ MagickExport void MagickXMakeMagnifyImag + % + % The format of the MagickXMakePixmap method is: + % +-% void MagickXMakeStandardColormap(Display *display,XVisualInfo *visual_info, +-% MagickXResourceInfo *resource_info,Image *image,XStandardColormap *map_info, +-% MagickXPixelInfo *pixel) ++% unsigned int MagickXMakePixmap(Display *display, ++% const MagickXResourceInfo *resource_info, ++% MagickXWindowInfo *window) + % + % A description of each parameter follows: + % +--- GraphicsMagick/magick/xwindow.c 2009/10/10 17:55:17 1.232 ++++ GraphicsMagick/magick/xwindow.c 2009/10/11 00:46:55 1.233 +@@ -1,5 +1,5 @@ + /* +-% Copyright (C) 2003, 2004 GraphicsMagick Group ++% Copyright (C) 2003 - 2009 GraphicsMagick Group + % Copyright (C) 2002 ImageMagick Studio + % + % This program is covered by multiple licenses, which are described in +@@ -808,7 +808,7 @@ static char **MagickFontToList(char *fon + for (p=font; *p != '\0'; p++) + if ((*p == ':') || (*p == ';') || (*p == ',')) + fonts++; +- fontlist=MagickAllocateMemory(char **,(fonts+1)*sizeof(char *)); ++ fontlist=MagickAllocateArray(char **,(fonts+1),sizeof(char *)); + if (fontlist == (char **) NULL) + { + MagickError3(ResourceLimitError,MemoryAllocationFailed, +@@ -1103,7 +1103,7 @@ MagickExport void MagickXBestPixel(Displ + /* + Read X server colormap. + */ +- colors=MagickAllocateMemory(XColor *,number_colors*sizeof(XColor)); ++ colors=MagickAllocateArray(XColor *,number_colors,sizeof(XColor)); + if (colors == (XColor *) NULL) + { + MagickError3(ResourceLimitError,MemoryAllocationFailed, +@@ -2133,10 +2133,10 @@ static void MagickXDitherImage(Image *im + for (i=0; i < 2; i++) + for (j=0; j < 16; j++) + { +- red_map[i][j]=MagickAllocateMemory(unsigned char *,256*sizeof(unsigned char)); +- green_map[i][j]=MagickAllocateMemory(unsigned char *, +- 256*sizeof(unsigned char)); +- blue_map[i][j]=MagickAllocateMemory(unsigned char *,256*sizeof(unsigned char)); ++ red_map[i][j]=MagickAllocateArray(unsigned char *,256,sizeof(unsigned char)); ++ green_map[i][j]=MagickAllocateArray(unsigned char *, ++ 256,sizeof(unsigned char)); ++ blue_map[i][j]=MagickAllocateArray(unsigned char *,256,sizeof(unsigned char)); + if ((red_map[i][j] == (unsigned char *) NULL) || + (green_map[i][j] == (unsigned char *) NULL) || + (blue_map[i][j] == (unsigned char *) NULL)) +@@ -3022,7 +3022,7 @@ MagickExport void MagickXGetPixelPacket( + if (pixel->pixels != (unsigned long *) NULL) + MagickFreeMemory(pixel->pixels); + pixel->pixels= +- MagickAllocateMemory(unsigned long *,packets*sizeof(unsigned long)); ++ MagickAllocateArray(unsigned long *,packets,sizeof(unsigned long)); + if (pixel->pixels == (unsigned long *) NULL) + MagickFatalError(ResourceLimitFatalError,MemoryAllocationFailed, + MagickMsg(XServerFatalError,UnableToGetPixelInfo)); +@@ -4073,8 +4073,8 @@ static Image *MagickXGetWindowImage(Disp + */ + max_windows+=1024; + if (window_info == (WindowInfo *) NULL) +- window_info=MagickAllocateMemory(WindowInfo *, +- max_windows*sizeof(WindowInfo)); ++ window_info=MagickAllocateArray(WindowInfo *, ++ max_windows,sizeof(WindowInfo)); + else + MagickReallocMemory(WindowInfo *,window_info,max_windows*sizeof(WindowInfo)); + } +@@ -4227,7 +4227,7 @@ static Image *MagickXGetWindowImage(Disp + /* + Get the window colormap. + */ +- colors=MagickAllocateMemory(XColor *,number_colors*sizeof(XColor)); ++ colors=MagickAllocateArray(XColor *,number_colors,sizeof(XColor)); + if (colors == (XColor *) NULL) + { + XDestroyImage(ximage); +@@ -4577,7 +4577,7 @@ MagickExport void MagickXGetWindowInfo(D + *segment_info; + + if (window->segment_info == (void *) NULL) +- window->segment_info=MagickAllocateMemory(void *,2*sizeof(XShmSegmentInfo)); ++ window->segment_info=MagickAllocateArray(void *,2,sizeof(XShmSegmentInfo)); + segment_info=(XShmSegmentInfo *) window->segment_info; + segment_info[0].shmid=(-1); + segment_info[0].shmaddr=NULL; +@@ -7734,8 +7734,8 @@ MagickExport void MagickXMakeStandardCol + Define Standard Colormap for StaticGray or StaticColor visual. + */ + number_colors=image->colors; +- colors=MagickAllocateMemory(XColor *, +- visual_info->colormap_size*sizeof(XColor)); ++ colors=MagickAllocateArray(XColor *, ++ visual_info->colormap_size,sizeof(XColor)); + if (colors == (XColor *) NULL) + MagickFatalError3(ResourceLimitError,MemoryAllocationFailed, + UnableToCreateColormap); +@@ -7774,8 +7774,8 @@ MagickExport void MagickXMakeStandardCol + Define Standard Colormap for GrayScale or PseudoColor visual. + */ + number_colors=image->colors; +- colors=MagickAllocateMemory(XColor *, +- visual_info->colormap_size*sizeof(XColor)); ++ colors=MagickAllocateArray(XColor *, ++ visual_info->colormap_size,sizeof(XColor)); + if (colors == (XColor *) NULL) + MagickFatalError3(ResourceLimitFatalError,MemoryAllocationFailed, + UnableToCreateColormap); +@@ -7820,8 +7820,8 @@ MagickExport void MagickXMakeStandardCol + /* + Define Standard colormap for shared GrayScale or PseudoColor visual. + */ +- diversity=MagickAllocateMemory(DiversityPacket *, +- image->colors*sizeof(DiversityPacket)); ++ diversity=MagickAllocateArray(DiversityPacket *, ++ image->colors,sizeof(DiversityPacket)); + if (diversity == (DiversityPacket *) NULL) + MagickFatalError3(ResourceLimitFatalError,MemoryAllocationFailed, + UnableToCreateColormap); +@@ -7882,8 +7882,9 @@ MagickExport void MagickXMakeStandardCol + /* + Read X server colormap. + */ +- server_colors=MagickAllocateMemory(XColor *, +- visual_info->colormap_size*sizeof(XColor)); ++ server_colors=MagickAllocateArray(XColor *, ++ visual_info->colormap_size, ++ sizeof(XColor)); + if (server_colors == (XColor *) NULL) + MagickFatalError3(ResourceLimitFatalError,MemoryAllocationFailed, + UnableToCreateColormap); +@@ -8023,7 +8024,7 @@ MagickExport void MagickXMakeStandardCol + /* + Allocate color array. + */ +- colors=MagickAllocateMemory(XColor *,number_colors*sizeof(XColor)); ++ colors=MagickAllocateArray(XColor *,number_colors,sizeof(XColor)); + if (colors == (XColor *) NULL) + MagickFatalError3(ResourceLimitFatalError,MemoryAllocationFailed, + UnableToCreateColormap); +--- GraphicsMagick/magick/memory.c 2009/10/05 23:57:54 1.54 ++++ GraphicsMagick/magick/memory.c 2009/10/09 18:20:22 1.55 +@@ -90,6 +90,43 @@ MagickExport void MagickAllocFunctions(M + % % + % % + % % +++ M a g i c k A r r a y Si z e % ++% % ++% % ++% % ++%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ++% ++% MagickArraySize() returnes the size of an array given two size_t arguments. ++% Zero is returned if the computed result overflows the size_t type. ++% ++% The format of the MagickArraySize method is: ++% ++% size_t MagickArraySize(const size_t count, const size_t size); ++% ++% A description of each parameter follows: ++% ++% o count: The number of elements in the array. ++% ++% o size: The size of one array element. ++% ++*/ ++MagickExport size_t MagickArraySize(const size_t count, const size_t size) ++{ ++ size_t ++ allocation_size; ++ ++ allocation_size = size * count; ++ if ((count != 0) && (size != allocation_size/count)) ++ allocation_size = 0; ++ ++ return allocation_size; ++} ++ ++/* ++%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ++% % ++% % ++% % + % M a g i c k M a l l o c % + % % + % % +@@ -155,9 +192,8 @@ MagickExport void *MagickMallocArray(con + *allocation; + + allocation = (void *) NULL; +- allocation_size = size * count; +- if ((count != 0) && (size != allocation_size/count)) +- allocation_size = 0; ++ allocation_size=MagickArraySize(count,size); ++ + if (allocation_size) + allocation = (MallocFunc)(allocation_size); + return allocation; +--- GraphicsMagick/magick/memory.h 2009/06/10 00:38:07 1.16 ++++ GraphicsMagick/magick/memory.h 2009/10/09 18:20:22 1.17 +@@ -22,7 +22,6 @@ extern MagickExport void + MagickAllocFunctions(MagickFreeFunc free_func,MagickMallocFunc malloc_func, + MagickReallocFunc realloc_func), + *MagickMalloc(const size_t size), +- *MagickMallocArray(const size_t count,const size_t size), + *MagickMallocCleared(const size_t size), + *MagickCloneMemory(void *destination,const void *source,const size_t size), + *MagickRealloc(void *memory,const size_t size), +@@ -30,6 +29,12 @@ extern MagickExport void + + #if defined(MAGICK_IMPLEMENTATION) + ++extern MagickExport void ++ *MagickMallocArray(const size_t count,const size_t size); ++ ++extern MagickExport size_t ++ MagickArraySize(const size_t count,const size_t size); ++ + /* + Allocate memory + */ diff -r 148a6b1dbe47 -r 085b6c465662 media-gfx/graphicsmagick/files/graphicsmagick-1.3.7-CVE-2009-3736.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/media-gfx/graphicsmagick/files/graphicsmagick-1.3.7-CVE-2009-3736.patch Thu Feb 11 23:05:12 2010 +0100 @@ -0,0 +1,21 @@ +--- ltdl/ltdl.c 2008-09-09 03:35:02.000000000 +0200 ++++ ltdl/ltdl.c.oden 2009-11-19 16:20:03.000000000 +0100 +@@ -529,7 +529,8 @@ find_module (lt_dlhandle *handle, const + /* Try to open the old library first; if it was dlpreopened, + we want the preopened version of it, even if a dlopenable + module is available. */ +- if (old_name && tryall_dlopen (handle, old_name, advise, 0) == 0) ++ if (old_name && tryall_dlopen (handle, old_name, ++ advise, lt_dlloader_find ("lt_preopen") ) == 0) + { + return 0; + } +@@ -1345,7 +1346,7 @@ try_dlopen (lt_dlhandle *phandle, const + } + #endif + } +- if (!file) ++ else + { + file = fopen (attempt, LT_READTEXT_MODE); + } diff -r 148a6b1dbe47 -r 085b6c465662 media-gfx/graphicsmagick/files/graphicsmagick-1.3.7-debian-fixed.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/media-gfx/graphicsmagick/files/graphicsmagick-1.3.7-debian-fixed.patch Thu Feb 11 23:05:12 2010 +0100 @@ -0,0 +1,366 @@ +Index: GraphicsMagick-1.3.7/magick/delegate.c +=================================================================== +--- GraphicsMagick-1.3.7.orig/magick/delegate.c ++++ GraphicsMagick-1.3.7/magick/delegate.c +@@ -454,7 +454,10 @@ MagickExport unsigned int InvokeDelegate + char + *command, + **commands, +- filename[MaxTextExtent]; ++ linkedname[MaxTextExtent], ++ linkedinfoname[MaxTextExtent], ++ filename[MaxTextExtent], ++ safechars[]="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.,-_+ /"; + + const DelegateInfo + *delegate_info; +@@ -474,6 +477,10 @@ MagickExport unsigned int InvokeDelegate + assert(image != (Image *) NULL); + assert(image->signature == MagickSignature); + temporary_image_filename=(*image->filename == '\0'); ++ linkedname[0]='\0'; ++ linkedname[MaxTextExtent-1]='\0'; ++ linkedinfoname[0]='\0'; ++ linkedinfoname[MaxTextExtent-1]='\0'; + if (temporary_image_filename) + { + /* Allocate a temporary filename if image is unnamed. */ +@@ -483,12 +490,24 @@ MagickExport unsigned int InvokeDelegate + return(False); + } + } ++ else if (strspn(image->filename, safechars) != strlen(image->filename)) ++ { ++ strncpy(linkedname,image->filename,MaxTextExtent-1); ++ if (!AcquireTemporarySymlink(image->filename,linkedname)) ++ { ++ (void) ThrowException(exception,FileOpenError,UnableToCreateTemporaryFile,image->filename); ++ return (False); ++ } ++ } ++ + (void) strlcpy(filename,image->filename,MaxTextExtent); + delegate_info=GetDelegateInfo(decode,encode,exception); + if (delegate_info == (DelegateInfo *) NULL) + { + if (temporary_image_filename) + (void) LiberateTemporaryFile(image->filename); ++ if (*linkedname) ++ strncpy(image->filename,linkedname,MaxTextExtent-1); + (void) ThrowException(exception,DelegateError,NoTagFound, + decode ? decode : encode); + return(False); +@@ -509,6 +528,18 @@ MagickExport unsigned int InvokeDelegate + } + image_info->temporary=True; + } ++ else if (strspn(image_info->filename, safechars) != strlen(image_info->filename)) ++ { ++ strncpy(linkedinfoname,image_info->filename,MaxTextExtent-1); ++ if (!AcquireTemporarySymlink(image_info->filename,linkedinfoname)) ++ { ++ if (temporary_image_filename) ++ LiberateTemporaryFile(image->filename); ++ (void) ThrowException(exception,FileOpenError,UnableToCreateTemporaryFile,image_info->filename); ++ return(False); ++ } ++ temporary_image_filename=True; ++ } + + if (delegate_info->mode != 0) + if ((decode && (delegate_info->encode != (char *) NULL)) || +@@ -532,6 +563,13 @@ MagickExport unsigned int InvokeDelegate + { + if (temporary_image_filename) + (void) LiberateTemporaryFile(image->filename); ++ if (*linkedname) ++ strncpy(image->filename,linkedname,MaxTextExtent-1); ++ if (*linkedinfoname) ++ { ++ LiberateTemporaryFile(linkedinfoname); ++ strncpy(image_info->filename,linkedinfoname,MaxTextExtent-1); ++ } + (void) ThrowException(exception,FileOpenError,UnableToCreateTemporaryFile,image_info->unique); + return(False); + } +@@ -540,6 +578,13 @@ MagickExport unsigned int InvokeDelegate + { + if (temporary_image_filename) + (void) LiberateTemporaryFile(image->filename); ++ if (*linkedname) ++ strncpy(image->filename,linkedname,MaxTextExtent-1); ++ if (*linkedinfoname) ++ { ++ LiberateTemporaryFile(linkedinfoname); ++ strncpy(image_info->filename,linkedinfoname,MaxTextExtent-1); ++ } + (void) LiberateTemporaryFile(image_info->unique); + (void) ThrowException(exception,FileOpenError,UnableToCreateTemporaryFile,image_info->zero); + return(False); +@@ -553,6 +598,13 @@ MagickExport unsigned int InvokeDelegate + (void) LiberateTemporaryFile(image_info->zero); + if (temporary_image_filename) + (void) LiberateTemporaryFile(image->filename); ++ if (*linkedname) ++ strncpy(image->filename,linkedname,MaxTextExtent-1); ++ if (*linkedinfoname) ++ { ++ LiberateTemporaryFile(linkedinfoname); ++ strncpy(image_info->filename,linkedinfoname,MaxTextExtent-1); ++ } + (void) ThrowException(exception,DelegateError,DelegateFailed, + decode ? decode : encode); + return(False); +@@ -578,6 +630,13 @@ MagickExport unsigned int InvokeDelegate + (void) LiberateTemporaryFile(image_info->zero); + if (temporary_image_filename) + (void) LiberateTemporaryFile(image->filename); ++ if (*linkedname) ++ strncpy(image->filename,linkedname,MaxTextExtent-1); ++ if (*linkedinfoname) ++ { ++ LiberateTemporaryFile(linkedinfoname); ++ strncpy(image_info->filename,linkedinfoname,MaxTextExtent-1); ++ } + DestroyImageInfo(clone_info); + (void) ThrowException(exception,DelegateError,DelegateFailed, + decode ? decode : encode); +@@ -599,6 +658,13 @@ MagickExport unsigned int InvokeDelegate + { + if (temporary_image_filename) + (void) LiberateTemporaryFile(image->filename); ++ if (*linkedname) ++ strncpy(image->filename,linkedname,MaxTextExtent-1); ++ if (*linkedinfoname) ++ { ++ LiberateTemporaryFile(linkedinfoname); ++ strncpy(image_info->filename,linkedinfoname,MaxTextExtent-1); ++ } + (void) ThrowException(exception,ResourceLimitError,MemoryAllocationFailed,decode ? decode : encode); + return(False); + } +@@ -733,6 +799,13 @@ MagickExport unsigned int InvokeDelegate + error_exit: + if (temporary_image_filename) + (void) LiberateTemporaryFile(image->filename); ++ if (*linkedname) ++ strncpy(image->filename,linkedname,MaxTextExtent-1); ++ if (*linkedinfoname) ++ { ++ LiberateTemporaryFile(linkedinfoname); ++ strncpy(image_info->filename,linkedinfoname,MaxTextExtent-1); ++ } + for ( ; commands[i] != (char *) NULL; i++) + MagickFreeMemory(commands[i]); + MagickFreeMemory(commands); +Index: GraphicsMagick-1.3.7/magick/symbols.h +=================================================================== +--- GraphicsMagick-1.3.7.orig/magick/symbols.h ++++ GraphicsMagick-1.3.7/magick/symbols.h +@@ -29,6 +29,7 @@ + #define AcquireTemporaryFileDescriptor GmAcquireTemporaryFileDescriptor + #define AcquireTemporaryFileName GmAcquireTemporaryFileName + #define AcquireTemporaryFileStream GmAcquireTemporaryFileStream ++#define AcquireTemporarySymlink GmAcquireTemporarySymlink + #define AdaptiveThresholdImage GmAdaptiveThresholdImage + #define AddDefinitions GmAddDefinitions + #define AddNoiseImage GmAddNoiseImage +Index: GraphicsMagick-1.3.7/magick/tempfile.c +=================================================================== +--- GraphicsMagick-1.3.7.orig/magick/tempfile.c ++++ GraphicsMagick-1.3.7/magick/tempfile.c +@@ -192,6 +192,93 @@ MagickExport MagickPassFail AcquireTempo + % % + % % + % % +++ A c q u i r e T e m p o r a r y S y m l i n k % ++% % ++% % ++% % ++%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ++% ++% AcquireTemporarySymlink replaces the contents of the string buffer pointed ++% to by filename with the unique name of a symbolic link. True is returned ++% if a symlink waas created, or False is returned if there is a failure. ++% The allocated symlink should be recovered via the LiberateTemporaryFile() ++% function once it is no longer required. ++% ++% The format of the AcquireTemporarySymlink method is: ++% ++% unsigned int AcquireTemporarySymlink(char *linkname, const char *name, ++% ExceptionInfo *exception) ++% ++% A description of each parameter follows. ++% ++% o linkname: Specifies a pointer to an array of characters that must be ++% MaxTextExtent characters of size. The unique ++% name of the symlink is returned in this array. ++% o name: Specifies a file name the symlink should point to. ++*/ ++MagickExport unsigned int AcquireTemporarySymlink(char *linkname, const char *name) ++{ ++ char ++ *tempdir, ++ tempname[MaxTextExtent]; ++ ++ int ++ fd, ++ tries; ++ ++ assert(linkname != (char *)NULL); ++ linkname[0]='\0'; ++ tempname[MaxTextExtent-1]='\0'; ++ ++ tempdir=getenv("MAGICK_TMPDIR"); ++#if defined(POSIX) ++ if (!tempdir) ++ tempdir=getenv("TMPDIR"); ++#endif /* POSIX */ ++#if defined(WIN32) ++ if (!tempdir) ++ tempdir=getenv("TMP"); ++ if (!tempdir) ++ tempdir=getenv("TEMP"); ++#endif /* WIN32 */ ++#if defined(P_tmpdir) ++ if (!tempdir) ++ tempdir=P_tmpdir; ++#endif ++ ++ for (tries=0; tries < 15; tries++) ++ { ++ strncpy(tempname,"gmXXXXXX",MaxTextExtent-1); ++ ComposeTemporaryFileName(tempname); ++ strncpy(linkname,tempdir,MaxTextExtent-1); ++ if (tempdir[strlen(tempdir)-1] != DirectorySeparator[0]) ++ strncat(linkname,DirectorySeparator,MaxTextExtent-1); ++ strncat(linkname,tempname,MaxTextExtent-1); ++ if (*name == '/') ++ fd=symlink(name, linkname); ++ else ++ { ++ char cname[MaxTextExtent]; ++ if (!getcwd(cname,(size_t)MaxTextExtent)) ++ return (False); ++ strncat(cname,DirectorySeparator,MaxTextExtent-1); ++ strncat(cname,name,MaxTextExtent-1); ++ fd=symlink(cname,linkname); ++ } ++ if (fd != -1) ++ { ++ AddTemporaryFileToList(linkname); ++ return (True); ++ } ++ } ++ return (False); ++} ++ ++/* ++%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ++% % ++% % ++% % + + A c q u i r e T e m p o r a r y F i l e D e s c r i p t o r % + % % + % % +Index: GraphicsMagick-1.3.7/magick/tempfile.h +=================================================================== +--- GraphicsMagick-1.3.7.orig/magick/tempfile.h ++++ GraphicsMagick-1.3.7/magick/tempfile.h +@@ -26,6 +26,7 @@ MagickExport void + + MagickExport MagickPassFail + AcquireTemporaryFileName(char *filename), ++ AcquireTemporarySymlink(char *linkname, const char *name), + LiberateTemporaryFile(char *filename); + + MagickExport int +Index: GraphicsMagick-1.3.7/magick/utility.c +=================================================================== +--- GraphicsMagick-1.3.7.orig/magick/utility.c ++++ GraphicsMagick-1.3.7/magick/utility.c +@@ -1222,6 +1222,72 @@ MagickExport void FormatString(char *str + % % + % % + % % ++% F o r m a t S t r i n g N u m e r i c % ++% % ++% % ++% % ++%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ++% ++% Method FormatStringNumeric formats output for a single numeric argument. ++% It takes into account that the format string given might be untrusted ++% user input, and returns a pointer to the formatted string. ++% ++% The format of the FormatStringNumeric method is: ++% ++% char * FormatStringNumeric(char *string,const char *format,int value) ++% ++% A description of each parameter follows. ++% ++% o format: A string describing the format to use to write the numeric ++% argument. Only the first numeric format identifier is replaced. ++% ++% o value: Numeric value to substitute into format string. ++% ++% ++*/ ++MagickExport char *FormatStringNumeric(const char *format,int value) ++{ ++ char ++ *p, ++ *string; ++ ++ string = NULL; ++ ++ (void) CloneString(&string, format); ++ ++ for (p=strchr(format,'%'); p != (char *) NULL; p=strchr(p+1,'%')) ++ { ++ char ++ *q; ++ ++ q=(char *) p+1; ++ if (*q == '0') ++ (void) strtol(q,&q,10); ++ if ((*q == '%') || (*q == 'd') || (*q == 'o') || (*q == 'x')) ++ { ++ char ++ c; ++ ++ q++; ++ c=*q; ++ *q='\0'; ++ (void) snprintf(string+(p-format),MaxTextExtent-(p-format),p,value); ++ *q=c; ++ (void) ConcatenateString(&string,q); ++ if (*(q-1) == '%') ++ p++; ++ else ++ break; ++ } ++ } ++ return string; ++} ++ ++/* ++%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ++% % ++% % ++% % + % G e t E x e c u t i o n P a t h % + % % + % % +Index: GraphicsMagick-1.3.7/magick/utility.h +=================================================================== +--- GraphicsMagick-1.3.7.orig/magick/utility.h ++++ GraphicsMagick-1.3.7/magick/utility.h +@@ -75,6 +75,7 @@ extern MagickExport char + *AllocateString(const char *), + *Base64Encode(const unsigned char *,const size_t,size_t *), + *EscapeString(const char *,const char), ++ *FormatStringNumeric(const char *,int), + *GetPageGeometry(const char *), + **ListFiles(const char *,const char *,long *), + *SetClientName(const char *), diff -r 148a6b1dbe47 -r 085b6c465662 media-gfx/graphicsmagick/files/graphicsmagick-1.3.7-perl-ldflags.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/media-gfx/graphicsmagick/files/graphicsmagick-1.3.7-perl-ldflags.patch Thu Feb 11 23:05:12 2010 +0100 @@ -0,0 +1,22 @@ +--- PerlMagick/Makefile.PL.in.orig 2010-01-10 20:05:53.000000000 +0000 ++++ PerlMagick/Makefile.PL.in 2010-01-10 23:27:53.000000000 +0000 +@@ -58,16 +58,16 @@ + 'LD' => $Config{'ld'} == $Config{'cc'} ? '@CC@' : $Config{'ld'}, + + # Linker flags for building an executable +- 'LDFLAGS' => "-L@MAGICKLIBDIR@ $Config{'ldflags'}", ++ 'LDFLAGS' => "$Config{'ldflags'} @LDFLAGS@", + + # Linker flags for building a dynamically loadable module +- 'LDDLFLAGS' => "-L@MAGICKLIBDIR@ $Config{'lddlflags'}", ++ 'LDDLFLAGS' => "$Config{'ldflags'} @LDFLAGS@ -L@MAGICKLIBDIR@ $Config{'lddlflags'}", + + # Install PerlMagick binary into GraphicsMagick bin directory + 'INSTALLBIN' => '@BIN_DIR@', + + # Library specification +- 'LIBS' => ['-L@MAGICKLIBDIR@ -lGraphicsMagick @LDFLAGS@ @MAGICK_DEP_LIBS@'], ++ 'LIBS' => ['@LDFLAGS@ -L@MAGICKLIBDIR@ -lGraphicsMagick @MAGICK_DEP_LIBS@'], + + # Perl binary name (if a Perl binary is built) + 'MAP_TARGET' => 'PerlMagick', diff -r 148a6b1dbe47 -r 085b6c465662 media-gfx/graphicsmagick/graphicsmagick-1.3.10.ebuild --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/media-gfx/graphicsmagick/graphicsmagick-1.3.10.ebuild Thu Feb 11 23:05:12 2010 +0100 @@ -0,0 +1,126 @@ +# Copyright 1999-2010 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/media-gfx/graphicsmagick/graphicsmagick-1.3.8.ebuild,v 1.1 2010/01/26 06:17:18 bicatali Exp $ + +EAPI="2" + +inherit eutils toolchain-funcs flag-o-matic perl-module + +MY_P=${P/graphicsm/GraphicsM} + +DESCRIPTION="Collection of tools and libraries for many image formats" +HOMEPAGE="http://www.graphicsmagick.org/" +SRC_URI="mirror://sourceforge/${PN}/${MY_P}.tar.bz2" + +LICENSE="MIT" +SLOT="0" +KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux ~ppc-macos" +IUSE="bzip2 cxx debug doc fpx imagemagick jbig jpeg jpeg2k lcms openmp + perl png q16 q32 svg threads tiff truetype X wmf zlib" + +RDEPEND="app-text/ghostscript-gpl + bzip2? ( app-arch/bzip2 ) + fpx? ( media-libs/libfpx ) + jbig? ( media-libs/jbigkit ) + jpeg? ( media-libs/jpeg ) + jpeg2k? ( >=media-libs/jasper-1.701.0 ) + lcms? ( media-libs/lcms ) + perl? ( dev-lang/perl ) + png? ( media-libs/libpng ) + svg? ( dev-libs/libxml2 ) + tiff? ( >=media-libs/tiff-3.8.2 ) + truetype? ( >=media-libs/freetype-2.0 ) + wmf? ( media-libs/libwmf ) + X? ( x11-libs/libXext x11-libs/libSM ) + imagemagick? ( !media-gfx/imagemagick )" + +DEPEND="${RDEPEND}" + +S="${WORKDIR}/${MY_P}" + +pkg_setup() { + if use openmp && + [[ $(tc-getCC)$ == *gcc* ]] && + ( [[ $(gcc-major-version)$(gcc-minor-version) -lt 42 ]] || + ! built_with_use sys-devel/gcc openmp ) + then + ewarn "You are using gcc and OpenMP is only available with gcc >= 4.2 " + ewarn "If you want to build fftw with OpenMP, abort now," + ewarn "and switch CC to an OpenMP capable compiler" + epause 5 + fi +} + +src_prepare() { + epatch "${FILESDIR}/${PN}-1.3.7-perl-ldflags.patch" + epatch "${FILESDIR}/${PN}-1.3.7-debian-fixed.patch" +} + +src_configure() { + local quantumDepth + if use q16 ; then + quantumDepth="16" + elif use q32 ; then + quantumDepth="32" + else + quantumDepth="8" + fi + + use debug && filter-flags -fomit-frame-pointer + econf \ + --docdir=/usr/share/doc/${PF} \ + --htmldir=/usr/share/doc/${PF}/html \ + --enable-shared \ + --enable-largefile \ + --without-included-ltdl \ + --without-frozenpaths \ + --without-gslib \ + --with-modules \ + --with-quantum-depth=${quantumDepth} \ + --with-fontpath="/usr/share/fonts" \ + --with-gs-font-dir="/usr/share/fonts/default/ghostscript" \ + --with-windows-font-dir="/usr/share/fonts/corefonts" \ + $(use_enable debug ccmalloc) \ + $(use_enable debug prof) \ + $(use_enable debug gcov) \ + $(use_enable imagemagick magick-compat) \ + $(use_enable openmp) \ + $(use_with bzip2 bzlib) \ + $(use_with cxx magick-plus-plus) \ + $(use_with fpx) \ + $(use_with jbig) \ + $(use_with jpeg) \ + $(use_with jpeg2k jp2) \ + $(use_with lcms) \ + $(use_with perl) \ + $(use_with png) \ + $(use_with svg xml) \ + $(use_with threads) \ + $(use_with tiff) \ + $(use_with truetype ttf) \ + $(use_with wmf) \ + $(use_with X x) \ + $(use_with zlib) +} + +src_compile() { + emake || die "emake failed" + if use perl; then + emake perl-build || die "emake perl failed" + fi +} + +src_test() { + emake check || die "tests failed" +} + +src_install() { + emake DESTDIR="${D}" install || die "emake install failed" + if use perl; then + perl -MExtUtils::MakeMaker -e 'MY->fixin(@ARGV)' PerlMagick/demo/*.pl + emake -C PerlMagick DESTDIR="${D}" \ + install || die "emake perl install failed" + fixlocalpod + fi + use doc || rm -rf "${D}"usr/share/doc/${PF}/html +} diff -r 148a6b1dbe47 -r 085b6c465662 media-gfx/graphicsmagick/metadata.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/media-gfx/graphicsmagick/metadata.xml Thu Feb 11 23:05:12 2010 +0100 @@ -0,0 +1,26 @@ + + + + + bicatali@gentoo.org + + Not really a maitainer, just helping out. Feel free to do anything + with the package. + + +graphics + + This is a port of GraphicsMagick(TM), the "swiss army knife" of + image processing. It provides a robust collection of tools and libraries + which support reading, writing, and manipulating an image in over 88 major + formats including formats like DPX, GIF, JPEG, JPEG-2000, PNG, PDF, + SVG and TIFF. + The program is the fork of a better-known ImageMagick (5.5.2), which + emphasizes end-user and API-stabilities. + + + Enable FlashPix support + Set quantum depth to 16 + Set quantum depth to 32 + +