]> granicus.if.org Git - imagemagick/commitdiff
(no commit message)
authorcristy <urban-warrior@git.imagemagick.org>
Sun, 18 May 2014 18:38:26 +0000 (18:38 +0000)
committercristy <urban-warrior@git.imagemagick.org>
Sun, 18 May 2014 18:38:26 +0000 (18:38 +0000)
Magick++/lib/Image.cpp
Magick++/lib/Options.cpp
MagickCore/animate.c
MagickCore/attribute.c
MagickCore/xml-tree.c
MagickCore/xwindow.c
coders/jnx.c
coders/jpeg.c
coders/wpg.c

index 251c1184982d0dd3f0b0cd4c2a7efec2c08cf634..5bb7d9fcb01c9c82ab7f136dba36e4da33454534 100644 (file)
@@ -2369,21 +2369,24 @@ void Magick::Image::colorMatrix(const size_t order_,
 
   GetPPException;
   kernel_info=AcquireKernelInfo((const char *) NULL);
-  kernel_info->width=order_;
-  kernel_info->height=order_;
-  kernel_info->values=(MagickRealType *) AcquireAlignedMemory(order_,
-    order_*sizeof(*kernel_info->values));
-  if (kernel_info->values != (MagickRealType *) NULL)
+  if (kernel_info != (KernelInfo *) NULL)
     {
-      MagickCore::Image
-        *newImage;
+      kernel_info->width=order_;
+      kernel_info->height=order_;
+      kernel_info->values=(MagickRealType *) AcquireAlignedMemory(order_,
+        order_*sizeof(*kernel_info->values));
+      if (kernel_info->values != (MagickRealType *) NULL)
+        {
+          MagickCore::Image
+            *newImage;
 
-      for (ssize_t i=0; i < (ssize_t) (order_*order_); i++)
-        kernel_info->values[i]=color_matrix_[i];
-      newImage=ColorMatrixImage(image(),kernel_info,&exceptionInfo);
-      replaceImage(newImage);
+          for (ssize_t i=0; i < (ssize_t) (order_*order_); i++)
+            kernel_info->values[i]=color_matrix_[i];
+          newImage=ColorMatrixImage(image(),kernel_info,&exceptionInfo);
+          replaceImage(newImage);
+        }
+      kernel_info=DestroyKernelInfo(kernel_info);
     }
-  kernel_info=DestroyKernelInfo(kernel_info);
   ThrowPPException;
 }
 
index 4c262c11c44d140c67b93212215cf469335c838f..0243194fd2f6c7a442c66e699b46ece51025029a 100644 (file)
@@ -348,7 +348,7 @@ void Magick::Options::magick(const std::string &magick_)
 
 std::string Magick::Options::magick(void) const
 {
-  if (_imageInfo->magick && *_imageInfo->magick)
+  if (*_imageInfo->magick)
     return(std::string(_imageInfo->magick));
 
   return(std::string());
index 9c48a79a3e9f3e7fa3357257ce8c2817ca67d9b7..457f65586d608621224a4f3bed0646f6177aa1fc 100644 (file)
@@ -2832,7 +2832,8 @@ MagickExport Image *XAnimateImages(Display *display,
         Free X resources.
       */
       if (windows->image.mapped != MagickFalse)
-        (void) XWithdrawWindow(display,windows->image.id,windows->image.screen);      XDelay(display,SuspendTime);
+        (void) XWithdrawWindow(display,windows->image.id,windows->image.screen);
+      XDelay(display,SuspendTime);
       (void) XFreeStandardColormap(display,icon_visual,icon_map,icon_pixel);
       if (resource_info->map_type == (char *) NULL)
         (void) XFreeStandardColormap(display,visual_info,map_info,pixel);
index 421cef003e0dd81cd7188826e0d8c8db4c2a5f39..8c4276800206c11378ef4fb4f7884bd7cf0d1080 100644 (file)
@@ -164,11 +164,13 @@ MagickExport RectangleInfo GetImageBoundingBox(const Image *image,
   GetPixelInfo(image,&target[1]);
   p=GetCacheViewVirtualPixels(image_view,(ssize_t) image->columns-1,0,1,1,
     exception);
-  GetPixelInfoPixel(image,p,&target[1]);
+  if (p == (const Quantum *) NULL)
+    GetPixelInfoPixel(image,p,&target[1]);
   GetPixelInfo(image,&target[2]);
   p=GetCacheViewVirtualPixels(image_view,0,(ssize_t) image->rows-1,1,1,
     exception);
-  GetPixelInfoPixel(image,p,&target[2]);
+  if (p == (const Quantum *) NULL)
+    GetPixelInfoPixel(image,p,&target[2]);
   status=MagickTrue;
   GetPixelInfo(image,&zero);
 #if defined(MAGICKCORE_OPENMP_SUPPORT)
index 2ba31dec6cc22186beaf315a242f7b8a8bd82c31..e3c8a82acfa1f231bce6c85cc2ed4ad436a3c00d 100644 (file)
@@ -1519,7 +1519,8 @@ static char *ParseEntities(char *xml,char **entities,int state)
                   xml=p+offset;
                   entity=strchr(xml,';');
                 }
-              (void) CopyMagickMemory(xml+length,entity+1,strlen(entity));
+              if (entity != (char *) NULL)
+                (void) CopyMagickMemory(xml+length,entity+1,strlen(entity));
               (void) strncpy(xml,entities[i],length);
             }
         }
@@ -1922,7 +1923,8 @@ static void ParseOpenTag(XMLTreeRoot *root,char *tag,char **attributes)
     xml_info->tag=ConstantString(tag);
   else
     xml_info=AddChildToXMLTree(xml_info,tag,strlen(xml_info->content));
-  xml_info->attributes=attributes;
+  if (xml_info != (XMLTreeInfo *) NULL)
+    xml_info->attributes=attributes;
   root->node=xml_info;
 }
 
index 29a1907c57372d3ebb9b86eee9144b8c9d695f0c..4feaf830e250c2d42df7cf96fcd406b32874e34c 100644 (file)
@@ -5098,8 +5098,7 @@ MagickExport Image *XImportImage(const ImageInfo *image_info,
       status=XGetWMName(display,target,&window_name);
       if (status == True)
         {
-          if ((image_info->filename != (char *) NULL) &&
-              (*image_info->filename == '\0'))
+          if (*image_info->filename == '\0')
             (void) CopyMagickString(image->filename,(char *) window_name.value,
               (size_t) window_name.nitems+1);
           (void) XFree((void *) window_name.value);
index 8f200688cb746bdd1493031796e961ab0f525e98..6eb8fce99b09f781affb43da45096c66a15bd4d4 100644 (file)
@@ -270,6 +270,8 @@ static Image *ReadJNXImage(const ImageInfo *image_info,ExceptionInfo *exception)
       if (tile_offset == -1)
         continue;
       restore_offset=TellBlob(image);
+      if (restore_offset < 0)
+        continue;
       offset=SeekBlob(image,(MagickOffsetType) tile_offset,SEEK_SET);
       if (offset != (MagickOffsetType) tile_offset)
         continue;
index 80a16e00b622c7fd599707ffab49c5ab84ddf4fa..91b6f015eb49e1639822089963496ef2f2bcd4a4 100644 (file)
@@ -1969,15 +1969,18 @@ static void WriteProfile(j_compress_ptr jpeg_info,Image *image)
           Add namespace to XMP profile.
         */
         xmp_profile=StringToStringInfo("http://ns.adobe.com/xap/1.0/ ");
-        ConcatenateStringInfo(xmp_profile,profile);
-        GetStringInfoDatum(xmp_profile)[28]='\0';
-        for (i=0; i < (ssize_t) GetStringInfoLength(xmp_profile); i+=65533L)
-        {
-          length=MagickMin(GetStringInfoLength(xmp_profile)-i,65533L);
-          jpeg_write_marker(jpeg_info,XML_MARKER,
-            GetStringInfoDatum(xmp_profile)+i,(unsigned int) length);
-        }
-        xmp_profile=DestroyStringInfo(xmp_profile);
+        if (xmp_profile != (StringINfo *) NULL)
+          {
+            ConcatenateStringInfo(xmp_profile,profile);
+            GetStringInfoDatum(xmp_profile)[28]='\0';
+            for (i=0; i < (ssize_t) GetStringInfoLength(xmp_profile); i+=65533L)
+            {
+              length=MagickMin(GetStringInfoLength(xmp_profile)-i,65533L);
+              jpeg_write_marker(jpeg_info,XML_MARKER,
+                GetStringInfoDatum(xmp_profile)+i,(unsigned int) length);
+            }
+            xmp_profile=DestroyStringInfo(xmp_profile);
+          }
       }
     (void) LogMagickEvent(CoderEvent,GetMagickModule(),
       "%s profile: %.20g bytes",name,(double) GetStringInfoLength(profile));
index c9a4f3cbff09d193eeecd39a202fb2cceccc199e..88110402b7587cba3b587876d988bc6791fd09dd 100644 (file)
@@ -541,6 +541,10 @@ RestoreMSCWarning \
 /* WPG2 raster reader. */
 static int UnpackWPG2Raster(Image *image,int bpp,ExceptionInfo *exception)
 {
+  int
+    RunCount,
+    XorMe = 0;
+
   size_t
     x,
     y;
@@ -548,15 +552,12 @@ static int UnpackWPG2Raster(Image *image,int bpp,ExceptionInfo *exception)
   ssize_t
     ldblk;
 
-  int XorMe = 0;
-
   unsigned int
     SampleSize=1;
 
   unsigned char
     bbuf,
     *BImgBuff,
-    RunCount,
     SampleBuffer[8] = { 0, 0, 0, 0, 0, 0, 0, 0 };
 
   unsigned int