]> granicus.if.org Git - imagemagick/commitdiff
(no commit message)
authorcristy <urban-warrior@git.imagemagick.org>
Mon, 4 Oct 2010 17:32:27 +0000 (17:32 +0000)
committercristy <urban-warrior@git.imagemagick.org>
Mon, 4 Oct 2010 17:32:27 +0000 (17:32 +0000)
ChangeLog
magick/stream.c

index 139f5871e26cfba4fe8008463b90bd61051bf54e..8abbc3e03d9788b282a82abe8e6c9926f8fb3f3d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,8 @@
 2010-10-03  6.6.4-9 Cristy  <quetzlzacatenango@image...>
   * Fix memory assertion with --enable-embeddable (reference
     http://www.imagemagick.org/discourse-server/viewtopic.php?f=3&t=17201).
+  * Don't permit access to pixels when pinging an image (reference
+    http://www.imagemagick.org/discourse-server/viewtopic.php?f=3&t=17194).
 
 2010-10-02  6.6.4-9 Anthony Thyssen <A.Thyssen@griffith...>
   * Added sqrt(2) bluring default for Gaussian Filter if used as a
index 936e879aefc77abc1f3917e876752808398f717a..ac1af83a752b4eec2a09ddba17b1ca7b85ee1f40 100644 (file)
@@ -703,17 +703,21 @@ static const PixelPacket *GetVirtualPixelStream(const Image *image,
   /*
     Pixels are stored in a temporary buffer until they are synced to the cache.
   */
+  cache_info->active_index_channel=((image->storage_class == PseudoClass) ||
+    (image->colorspace == CMYKColorspace)) ? MagickTrue : MagickFalse;
   number_pixels=(MagickSizeType) columns*rows;
   length=(size_t) number_pixels*sizeof(PixelPacket);
-  if ((image->storage_class == PseudoClass) ||
-      (image->colorspace == CMYKColorspace))
+  if (cache_info->active_index_channel != MagickFalse)
     length+=number_pixels*sizeof(IndexPacket);
   if (cache_info->pixels == (PixelPacket *) NULL)
     {
       cache_info->length=length;
       status=AcquireStreamPixels(cache_info,exception);
       if (status == MagickFalse)
-        return((PixelPacket *) NULL);
+        {
+          cache_info->length=0;
+          return((PixelPacket *) NULL);
+        }
     }
   else
     if (cache_info->length != length)
@@ -722,11 +726,13 @@ static const PixelPacket *GetVirtualPixelStream(const Image *image,
         cache_info->length=length;
         status=AcquireStreamPixels(cache_info,exception);
         if (status == MagickFalse)
-          return((PixelPacket *) NULL);
+          {
+            cache_info->length=0;
+            return((PixelPacket *) NULL);
+          }
       }
   cache_info->indexes=(IndexPacket *) NULL;
-  if ((image->storage_class == PseudoClass) ||
-      (image->colorspace == CMYKColorspace))
+  if (cache_info->active_index_channel != MagickFalse)
     cache_info->indexes=(IndexPacket *) (cache_info->pixels+number_pixels);
   return(cache_info->pixels);
 }
@@ -855,12 +861,13 @@ static PixelPacket *QueueAuthenticPixelsStream(Image *image,const ssize_t x,
   /*
     Pixels are stored in a temporary buffer until they are synced to the cache.
   */
+  cache_info->active_index_channel=((image->storage_class == PseudoClass) ||
+    (image->colorspace == CMYKColorspace)) ? MagickTrue : MagickFalse;
   cache_info->columns=columns;
   cache_info->rows=rows;
   number_pixels=(MagickSizeType) columns*rows;
   length=(size_t) number_pixels*sizeof(PixelPacket);
-  if ((image->storage_class == PseudoClass) ||
-      (image->colorspace == CMYKColorspace))
+  if (cache_info->active_index_channel != MagickFalse)
     length+=number_pixels*sizeof(IndexPacket);
   if (cache_info->pixels == (PixelPacket *) NULL)
     {
@@ -877,8 +884,7 @@ static PixelPacket *QueueAuthenticPixelsStream(Image *image,const ssize_t x,
   if (cache_info->pixels == (void *) NULL)
     return((PixelPacket *) NULL);
   cache_info->indexes=(IndexPacket *) NULL;
-  if ((image->storage_class == PseudoClass) ||
-      (image->colorspace == CMYKColorspace))
+  if (cache_info->active_index_channel != MagickFalse)
     cache_info->indexes=(IndexPacket *) (cache_info->pixels+number_pixels);
   return(cache_info->pixels);
 }