changeset 1704:d91812cc9d4b

merge
author Johannes Hofmann <Johannes.Hofmann@gmx.de>
date Mon, 06 Sep 2010 22:36:04 +0200
parents deed598ea249 (current diff) 341debc7a62c (diff)
children e247df789bdc 653b44cc23fa
files
diffstat 1 files changed, 11 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/src/png.c	Mon Sep 06 22:35:14 2010 +0200
+++ b/src/png.c	Mon Sep 06 22:36:04 2010 +0200
@@ -65,8 +65,8 @@
    int version;                 /* Secondary Key for the dicache */
 
    double display_exponent;     /* gamma correction */
-   ulong_t width;               /* png image width */
-   ulong_t height;              /* png image height */
+   png_uint_32 width;           /* png image width */
+   png_uint_32 height;          /* png image height */
    png_structp png_ptr;         /* libpng private data */
    png_infop info_ptr;          /* libpng private info */
    uchar_t *image_data;         /* decoded image data    */
@@ -135,17 +135,17 @@
                 &bit_depth, &color_type, &interlace_type, NULL, NULL);
 
    /* check max image size */
-   if (png->width <= 0 || png->height <= 0 ||
+   if (png->width == 0 || png->height == 0 ||
        png->width > IMAGE_MAX_AREA / png->height) {
-      MSG("Png_datainfo_callback: suspicious image size request %ldx%ld\n",
-          png->width, png->height);
+      MSG("Png_datainfo_callback: suspicious image size request %lux%lu\n",
+          (ulong_t) png->width, (ulong_t) png->height);
       Png_error_handling(png_ptr, "Aborting...");
       return; /* not reached */
    }
 
-   _MSG("Png_datainfo_callback: png->width  = %ld\n"
-        "Png_datainfo_callback: png->height = %ld\n",
-        png->width, png->height);
+   _MSG("Png_datainfo_callback: png->width  = %lu\n"
+        "Png_datainfo_callback: png->height = %lu\n",
+        (ulong_t) png->width, (ulong_t) png->height);
 
    /* we need RGB/RGBA in the end */
    if (color_type == PNG_COLOR_TYPE_PALETTE && bit_depth <= 8) {
@@ -193,9 +193,9 @@
 
    /* init Dillo specifics */
    _MSG("Png_datainfo_callback: rowbytes = %d\n"
-        "Png_datainfo_callback: width    = %ld\n"
-        "Png_datainfo_callback: height   = %ld\n",
-        png->rowbytes, png->width, png->height);
+        "Png_datainfo_callback: width    = %lu\n"
+        "Png_datainfo_callback: height   = %lu\n",
+        png->rowbytes, (ulong_t) png->width, (ulong_t) png->height);
 
    png->image_data = (uchar_t *) dMalloc(png->rowbytes * png->height);
    png->row_pointers = (uchar_t **) dMalloc(png->height * sizeof(uchar_t *));