Sophie

Sophie

distrib > Mageia > 1 > i586 > media > core-updates-src > by-pkgid > b0202108aaa53fc5834cfeb063e09c6d > files > 8

imagemagick-6.6.6.10-5.3.mga1.src.rpm

--- coders/png.c.orig	2012-08-22 17:43:11.126382611 -0400
+++ coders/png.c	2012-08-22 17:49:02.305353652 -0400
@@ -1372,7 +1372,11 @@
 }
 
 #ifdef PNG_USER_MEM_SUPPORTED
-static png_voidp png_IM_malloc(png_structp png_ptr,png_uint_32 size)
+#if PNG_LIBPNG_VER >= 14000
+static png_voidp png_IM_malloc(png_structp png_ptr,png_alloc_size_t size)
+#else
+static png_voidp png_IM_malloc(png_structp png_ptr,png_size_t size)
+#endif
 {
 #if (PNG_LIBPNG_VER < 10011)
   png_voidp
@@ -6653,12 +6657,22 @@
          (char *) profile_type, (double) length);
      }
 
-   text=(png_textp) png_malloc(ping,(png_uint_32) sizeof(png_text));
+#if PNG_LIBPNG_VER >= 14000
+   text=(png_textp) png_malloc(ping,(png_alloc_size_t) sizeof(png_text));
+#else
+   text=(png_textp) png_malloc(ping,(png_size_t) sizeof(png_text));
+#endif
    description_length=(png_uint_32) strlen((const char *) profile_description);
    allocated_length=(png_uint_32) (length*2 + (length >> 5) + 20
       + description_length);
-   text[0].text=(png_charp) png_malloc(ping,allocated_length);
-   text[0].key=(png_charp) png_malloc(ping, (png_uint_32) 80);
+#if PNG_LIBPNG_VER >= 14000
+   text[0].text=(png_charp) png_malloc(ping,
+      (png_alloc_size_t) allocated_length);
+   text[0].key=(png_charp) png_malloc(ping, (png_alloc_size_t) 80);
+#else
+   text[0].text=(png_charp) png_malloc(ping, (png_size_t) allocated_length);
+   text[0].key=(png_charp) png_malloc(ping, (png_size_t) 80);
+#endif
    text[0].key[0]='\0';
    (void) ConcatenateMagickString(text[0].key,
       "Raw profile type ",MaxTextExtent);
@@ -8947,7 +8961,12 @@
       value=GetImageProperty(image,property);
       if (value != (const char *) NULL)
         {
-          text=(png_textp) png_malloc(ping,(png_uint_32) sizeof(png_text));
+#if PNG_LIBPNG_VER >= 14000
+	  text=(png_textp) png_malloc(ping,
+	       (png_alloc_size_t) sizeof(png_text));
+#else
+	  text=(png_textp) png_malloc(ping,(png_size_t) sizeof(png_text));
+#endif
           text[0].key=(char *) property;
           text[0].text=(char *) value;
           text[0].text_length=strlen(value);