]> granicus.if.org Git - imagemagick/blobdiff - magick/property.c
(no commit message)
[imagemagick] / magick / property.c
index c3ee031fb4a91d0e3d21ef59799fbeed75a48809..60acd764164dbf46efddbbdc5f89287a0484f467 100644 (file)
@@ -327,7 +327,7 @@ MagickExport MagickBooleanType FormatImageProperty(Image *image,
   char
     value[MaxTextExtent];
 
-  int
+  ssize_t
     n;
 
   va_list
@@ -588,7 +588,7 @@ static MagickBooleanType Get8BIMProperty(const Image *image,const char *key)
     if ((count != 0) && ((size_t) count <= length))
       {
         resource=(char *) NULL;
-        if (~(1UL*count) >= MaxTextExtent)
+        if (~(1UL*count) >= (MaxTextExtent-1))
           resource=(char *) AcquireQuantumMemory((size_t) count+MaxTextExtent,
             sizeof(*resource));
         if (resource != (char *) NULL)
@@ -625,7 +625,7 @@ static MagickBooleanType Get8BIMProperty(const Image *image,const char *key)
       We have the resource of interest.
     */
     attribute=(char *) NULL;
-    if (~(1UL*count) >= MaxTextExtent)
+    if (~(1UL*count) >= (MaxTextExtent-1))
       attribute=(char *) AcquireQuantumMemory((size_t) count+MaxTextExtent,
         sizeof(*attribute));
     if (attribute != (char *) NULL)
@@ -732,7 +732,7 @@ static MagickBooleanType GetEXIFProperty(const Image *image,
    { \
      length+=FormatLocaleString(buffer+length,MaxTextExtent-length, \
        format", ",arg); \
-     if (length >= MaxTextExtent - 1) \
+     if (length >= (MaxTextExtent-1)) \
        length=MaxTextExtent-1; \
      p1+=size; \
    } \
@@ -758,7 +758,7 @@ static MagickBooleanType GetEXIFProperty(const Image *image,
    { \
      length+=FormatLocaleString(buffer+length,MaxTextExtent-length, \
        format", ",arg1, arg2); \
-     if (length >= MaxTextExtent - 1) \
+     if (length >= (MaxTextExtent-1)) \
        length=MaxTextExtent-1; \
      p1+=size; \
    } \
@@ -1659,10 +1659,10 @@ static char *TracePSClippath(const unsigned char *blob,size_t length,
           xx=ReadPropertyMSBLong(&blob,&length);
           x=(ssize_t) xx;
           if (xx > 2147483647)
-            x=(ssize_t) xx-4294967295-1;
+            x=(ssize_t) xx-4294967295U-1;
           y=(ssize_t) yy;
           if (yy > 2147483647)
-            y=(ssize_t) yy-4294967295-1;
+            y=(ssize_t) yy-4294967295U-1;
           point[i].x=(double) x/4096/4096;
           point[i].y=1.0-(double) y/4096/4096;
         }
@@ -1856,10 +1856,10 @@ static char *TraceSVGClippath(const unsigned char *blob,size_t length,
           xx=ReadPropertyMSBLong(&blob,&length);
           x=(ssize_t) xx;
           if (xx > 2147483647)
-            x=(ssize_t) xx-4294967295-1;
+            x=(ssize_t) xx-4294967295U-1;
           y=(ssize_t) yy;
           if (yy > 2147483647)
-            y=(ssize_t) yy-4294967295-1;
+            y=(ssize_t) yy-4294967295U-1;
           point[i].x=(double) x*columns/4096/4096;
           point[i].y=(double) y*rows/4096/4096;
         }