]> granicus.if.org Git - imagemagick/commitdiff
Fix segmentation fault for +channel in IMv7
authoranthony <anthony@git.imagemagick.org>
Mon, 3 Jun 2013 07:43:50 +0000 (07:43 +0000)
committeranthony <anthony@git.imagemagick.org>
Mon, 3 Jun 2013 07:43:50 +0000 (07:43 +0000)
MagickCore/pixel.h
MagickWand/operation.c

index 5c6285af2d255d8066451be6ecf3cf32e99e863d..4c717f7b94f8093aa7b24ccddf75b9e2653a81b4 100644 (file)
@@ -43,10 +43,10 @@ typedef enum
   BlackChannel = 0x0008,
   AlphaChannel = 0x0010,
   OpacityChannel = 0x0010,
-  IndexChannel = 0x0020,
-  ReadMaskChannel = 0x0040,
-  WriteMaskChannel = 0x0080,
-  MetaChannel = 0x0100,
+  IndexChannel = 0x0020,             /* Color Index Table? */
+  ReadMaskChannel = 0x0040,          /* Pixel is Not Readable? */
+  WriteMaskChannel = 0x0080,         /* Pixel is Write Protected? */
+  MetaChannel = 0x0100,              /* ???? */
   CompositeChannels = 0x002F,
   AllChannels = 0x7ffffff,
   /*
@@ -54,6 +54,7 @@ typedef enum
     FUTURE: are these needed any more - they are more like hacks
     SyncChannels for example is NOT a real channel but a 'flag'
     It really says -- "User has not defined channels"
+    Though it does have extra meaning in the "-auto-level" operator
   */
   TrueAlphaChannel = 0x0100, /* extract actual alpha channel from opacity */
   RGBChannels = 0x0200,      /* set alpha from grayscale mask in RGB */
@@ -84,9 +85,9 @@ typedef enum
   ReadMaskPixelChannel = 6,
   WriteMaskPixelChannel = 7,
   MetaPixelChannel = 8,
-  IntensityPixelChannel = MaxPixelChannels,
-  CompositePixelChannel = MaxPixelChannels,
-  SyncPixelChannel = MaxPixelChannels+1
+  IntensityPixelChannel = MaxPixelChannels,  /* ???? */
+  CompositePixelChannel = MaxPixelChannels,  /* ???? */
+  SyncPixelChannel = MaxPixelChannels+1      /* not a real channel */
 } PixelChannel;  /* must correspond to ChannelType */
 
 typedef enum
@@ -116,7 +117,7 @@ typedef enum
   IntegerInterpolatePixel,    /* Integer (floor) interpolation */
   MeshInterpolatePixel,       /* Triangular Mesh interpolation */
   NearestInterpolatePixel,    /* Nearest Neighbour Only */
-  SplineInterpolatePixel     /* Cubic Spline (blurred) interpolation */
+  SplineInterpolatePixel      /* Cubic Spline (blurred) interpolation */
   /* FilterInterpolatePixel,  ** Use resize filter - (very slow) */
 } PixelInterpolateMethod;
 
index 0611999029e8e189c3f45b1bfcb3618ca39f184f..e9e413131c2cb4cacc056e2ec90099cd15843447 100644 (file)
@@ -162,7 +162,7 @@ static inline Image *GetImageCache(const ImageInfo *image_info,const char *path,
   an array of floating point values than call SparseColorImage().
   Argument is a complex mix of floating-point pixel coodinates, and color
   specifications (or direct floating point numbers).  The number of floats
-  needed to represent a color varies depending on teh current channel
+  needed to represent a color varies depending on the current channel
   setting.
 
   This really should be in MagickCore, so that other API's can make use of it.
@@ -603,8 +603,7 @@ WandPrivate void CLISettingOptionInfo(MagickCLI *cli_wand,
         }
       if (LocaleCompare("channel",option+1) == 0)
         {
-          arg1=ArgOption("default");
-          parse=ParseChannelOption(arg1);
+          parse=ParseChannelOption(ArgOption("Default"));
           if (parse < 0)
             CLIWandExceptArgBreak(OptionError,"UnrecognizedChannelType",
                  option,arg1);