]> granicus.if.org Git - imagemagick/commitdiff
(no commit message)
authorcristy <urban-warrior@git.imagemagick.org>
Sun, 25 May 2014 23:27:26 +0000 (23:27 +0000)
committercristy <urban-warrior@git.imagemagick.org>
Sun, 25 May 2014 23:27:26 +0000 (23:27 +0000)
MagickCore/blob.c
MagickCore/utility.c
MagickCore/xml-tree.c
MagickCore/xwindow.c
coders/psd.c

index cbcae1bd5063ffeb1e453b86999f59a78472d9ef..678c5cfa4834c1470f6709db9cfa0a4bf0d338df 100644 (file)
@@ -723,7 +723,8 @@ MagickExport unsigned char *DetachBlob(BlobInfo *blob_info)
 %
 %  The format of the DiscardBlobBytes method is:
 %
-%      MagickBooleanType DiscardBlobBytes(Image *image,const size_t length)
+%      MagickBooleanType DiscardBlobBytes(Image *image,
+%        const MagickSizeType length)
 %
 %  A description of each parameter follows.
 %
@@ -3822,10 +3823,13 @@ MagickPrivate MagickBooleanType SetBlobExtent(Image *image,
           if (image->blob->synchronize != MagickFalse)
             {
               int
+                file,
                 status;
 
-              status=posix_fallocate(fileno(image->blob->file_info.file),offset,
-                extent-offset);
+              file=fileno(image->blob->file_info.file);
+              if (file == -1)
+                return(MagickFalse);
+              status=posix_fallocate(file,offset,extent-offset);
               if (status != 0)
                 return(MagickFalse);
             }
index dedbfca6d4e14ed8c6ce4a36c8921571ba8465c8..be9849b26612601904b838ad357002ecbc9c0228 100644 (file)
@@ -453,6 +453,7 @@ MagickExport unsigned char *Base64Decode(const char *source,size_t *length)
               decode=(unsigned char *) RelinquishMagickMemory(decode);
               return((unsigned char *) NULL);
             }
+          break;
         }
       }
     }
index c38de9a9a23d1cb6581f28142f0a6e734f8e96e0..5961189380f40f59561dd6d43090293737ebf957 100644 (file)
@@ -1489,40 +1489,41 @@ static char *ParseEntities(char *xml,char **entities,int state)
           if (entities[i++] == (char *) NULL)
             xml++;
           else
-            {
-              /*
-                Found a match.
-              */
-              length=strlen(entities[i]);
-              entity=strchr(xml,';');
-              if ((length-1L) >= (size_t) (entity-xml))
-                {
-                  offset=(ssize_t) (xml-p);
-                  extent=(size_t) (offset+length+strlen(entity));
-                  if (p != q)
-                    p=(char *) ResizeQuantumMemory(p,extent,sizeof(*p));
-                  else
-                    {
-                      char
-                        *xml;
-
-                      xml=(char *) AcquireQuantumMemory(extent,sizeof(*xml));
-                      if (xml != (char *) NULL)
-                        {
-                          (void) CopyMagickString(xml,p,extent*sizeof(*xml));
-                          p=xml;
-                        }
-                    }
-                  if (p == (char *) NULL)
-                    ThrowFatalException(ResourceLimitFatalError,
-                      "MemoryAllocationFailed");
-                  xml=p+offset;
-                  entity=strchr(xml,';');
-                }
-              if (entity != (char *) NULL)
-                (void) CopyMagickMemory(xml+length,entity+1,strlen(entity));
-              (void) strncpy(xml,entities[i],length);
-            }
+            if (entities[i] != (char *) NULL)
+              {
+                /*
+                  Found a match.
+                */
+                length=strlen(entities[i]);
+                entity=strchr(xml,';');
+                if ((length-1L) >= (size_t) (entity-xml))
+                  {
+                    offset=(ssize_t) (xml-p);
+                    extent=(size_t) (offset+length+strlen(entity));
+                    if (p != q)
+                      p=(char *) ResizeQuantumMemory(p,extent,sizeof(*p));
+                    else
+                      {
+                        char
+                          *xml;
+
+                        xml=(char *) AcquireQuantumMemory(extent,sizeof(*xml));
+                        if (xml != (char *) NULL)
+                          {
+                            (void) CopyMagickString(xml,p,extent*sizeof(*xml));
+                            p=xml;
+                          }
+                      }
+                    if (p == (char *) NULL)
+                      ThrowFatalException(ResourceLimitFatalError,
+                        "MemoryAllocationFailed");
+                    xml=p+offset;
+                    entity=strchr(xml,';');
+                  }
+                if (entity != (char *) NULL)
+                  (void) CopyMagickMemory(xml+length,entity+1,strlen(entity));
+                (void) strncpy(xml,entities[i],length);
+              }
         }
       else
         if (((state == ' ') || (state == '*')) &&
index a1bb9188ee8199b9e02b77a2a60e12c9a3f02ca9..e877be8753e3f7cc3e549dd9affb5f933575e3e8 100644 (file)
@@ -4935,8 +4935,7 @@ MagickExport Image *XImportImage(const ImageInfo *image_info,
   crop_info.height=0;
   root=XRootWindow(display,XDefaultScreen(display));
   target=(Window) NULL;
-  if ((image_info->filename != (char *) NULL) &&
-      (*image_info->filename != '\0'))
+  if (*image_info->filename != '\0')
     {
       if (LocaleCompare(image_info->filename,"root") == 0)
         target=root;
index 97a2684bdecd500e6efbbb8ff29086f951bd04aa..9c3946d267778a7768cba0b45388469fe6644c1e 100644 (file)
@@ -1198,12 +1198,11 @@ static MagickStatusType ReadPSDLayers(Image *image,const ImageInfo *image_info,
           if ((count != 0) && (LocaleNCompare(type,"Lr16",4) == 0))
             size=GetPSDSize(psd_info,image);
           else
-            if (DiscardBlobBytes(image,size-(ssize_t) quantum-12) == MagickFalse)
+            if (DiscardBlobBytes(image,(MagickSizeType) size-quantum-12) == MagickFalse)
               ThrowFileException(exception,CorruptImageError,
                 "UnexpectedEndOfFile",image->filename);
         }
     }
-
   status=MagickTrue;
   if (size != 0)
     {