]> granicus.if.org Git - imagemagick/commitdiff
(no commit message)
authorcristy <urban-warrior@git.imagemagick.org>
Thu, 2 Sep 2010 11:22:46 +0000 (11:22 +0000)
committercristy <urban-warrior@git.imagemagick.org>
Thu, 2 Sep 2010 11:22:46 +0000 (11:22 +0000)
14 files changed:
coders/bmp.c
coders/cin.c
coders/dcm.c
coders/fits.c
coders/meta.c
coders/pdb.c
coders/pes.c
coders/psd.c
coders/rla.c
coders/sgi.c
coders/viff.c
coders/xcf.c
magick/profile.c
magick/property.c

index 4e6d928f34aae3ad4ef017a94ab293d06146d07a..2e8870f8bfbd4b1ff77738f694f5e1dbc38e0192 100644 (file)
@@ -711,7 +711,7 @@ static Image *ReadBMPImage(const ImageInfo *image_info,ExceptionInfo *exception)
               Read color management information.
             */
             bmp_info.alpha_mask=ReadBlobLSBLong(image);
-            bmp_info.colorspace=(ssize_t) ReadBlobLSBLong(image);
+            bmp_info.colorspace=(int) ReadBlobLSBLong(image);
             /*
               Decode 2^30 fixed point formatted CIE primaries.
             */
index 22462da3a8a8466d0e666f9c6a4c6725e2a2d8ef..771585448dcd568c2da5027050f2b99835896044 100644 (file)
@@ -581,12 +581,12 @@ static Image *ReadCINImage(const ImageInfo *image_info,
   /*
     Image origination information.
   */
-  cin.origination.x_offset=(ssize_t) ReadBlobLong(image);
+  cin.origination.x_offset=(int) ReadBlobLong(image);
   offset+=4;
   if ((size_t) cin.origination.x_offset != ~0UL)
     (void) FormatImageProperty(image,"cin:origination.x_offset","%.20g",
       (double) cin.origination.x_offset);
-  cin.origination.y_offset=(ssize_t) ReadBlobLong(image);
+  cin.origination.y_offset=(int) ReadBlobLong(image);
   offset+=4;
   if ((size_t) cin.origination.y_offset != ~0UL)
     (void) FormatImageProperty(image,"cin:origination.y_offset","%.20g",
index f542dc07d2176fb0d7133afc8aa738156ce63774..295e41ebbb0faf589db33a1bbad13565df3472da 100644 (file)
@@ -3494,7 +3494,7 @@ static Image *ReadDCMImage(const ImageInfo *image_info,ExceptionInfo *exception)
           if (stream_info->offsets == (ssize_t *) NULL)
             ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed");
           for (i=0; i < (ssize_t) stream_info->offset_count; i++)
-            stream_info->offsets[i]=(ssize_t) ReadBlobLSBLong(image);
+            stream_info->offsets[i]=(int) ReadBlobLSBLong(image);
           offset=TellBlob(image);
           for (i=0; i < (ssize_t) stream_info->offset_count; i++)
             stream_info->offsets[i]+=offset;
@@ -3619,7 +3619,7 @@ static Image *ReadDCMImage(const ImageInfo *image_info,ExceptionInfo *exception)
           if (stream_info->offsets == (ssize_t *) NULL)
             ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed");
           for (i=0; i < (ssize_t) stream_info->offset_count; i++)
-            stream_info->offsets[i]=(ssize_t) ReadBlobLSBLong(image);
+            stream_info->offsets[i]=(int) ReadBlobLSBLong(image);
           offset=TellBlob(image);
           for (i=0; i < (ssize_t) stream_info->offset_count; i++)
             stream_info->offsets[i]+=offset;
@@ -3647,7 +3647,7 @@ static Image *ReadDCMImage(const ImageInfo *image_info,ExceptionInfo *exception)
         stream_info->count=0;
         stream_info->segment_count=ReadBlobLSBLong(image);
         for (i=0; i < 15; i++)
-           stream_info->segments[i]=(ssize_t) ReadBlobLSBLong(image);
+           stream_info->segments[i]=(int) ReadBlobLSBLong(image);
         stream_info->remaining-=64;
       }
     image->columns=(size_t) width;
index ed546ff6919c66d8594e88a7353077567df320ce..ce111495bb5683295c13a1ba30e8270bb1059852 100644 (file)
@@ -152,7 +152,7 @@ static inline double GetFITSPixel(Image *image,int bits_per_pixel)
     case 4:
     {
       if (bits_per_pixel > 0)
-        return((double) ((ssize_t) ReadBlobLong(image)));
+        return((double) ((int) ReadBlobLong(image)));
       return((double) ReadBlobFloat(image));
     }
     case 8:
index cc4341da70b191a2c361819d3be77004b739d89c..167708407907a94f1ad8bce7918266cdd3cfe522 100644 (file)
@@ -2187,7 +2187,7 @@ static int format8BIM(Image *ifile, Image *ofile)
           return(-1);
       }
     }
-    count = (ssize_t) ReadBlobMSBLong(ifile);
+    count = (int) ReadBlobMSBLong(ifile);
     if (count < 0) return -1;
     /* make a buffer to hold the datand snag it from the input stream */
     str=(unsigned char *) AcquireQuantumMemory((size_t) count,sizeof(*str));
index 06f7445b5c022f1455097056f4ae83a238922930..18a14126552738ff6e378a1dbe5cdac052848f59 100644 (file)
@@ -351,7 +351,7 @@ static Image *ReadPDBImage(const ImageInfo *image_info,ExceptionInfo *exception)
   /*
     Read record header.
   */
-  img_offset=(ssize_t) ReadBlobMSBLong(image); /* TS */
+  img_offset=(int) ReadBlobMSBLong(image); /* TS */
   attributes=(unsigned char) ReadBlobByte(image);
   count=ReadBlob(image,3,(unsigned char *) tag);
   if (count != 3  ||  memcmp(tag,"\x6f\x80\x00",3) != 0)
@@ -359,7 +359,7 @@ static Image *ReadPDBImage(const ImageInfo *image_info,ExceptionInfo *exception)
 
   if (pdb_info.number_records > 1)
     {
-      comment_offset=(ssize_t) ReadBlobMSBLong(image);
+      comment_offset=(int) ReadBlobMSBLong(image);
       attributes=(unsigned char) ReadBlobByte(image);
       count=ReadBlob(image,3,(unsigned char *) tag);
       if (count != 3  ||  memcmp(tag,"\x6f\x80\x01",3) != 0)
index 11da30cf308f2f7aa5547af95c79827df3090b82..4a08c6c00b2c58ce98f9ed2a2bd2e21b05272b65 100644 (file)
@@ -492,7 +492,7 @@ static Image *ReadPESImage(const ImageInfo *image_info,ExceptionInfo *exception)
   if ((count != 4) || (LocaleNCompare((char *) magick,"#PES",4) != 0))
     ThrowReaderException(CorruptImageError,"ImproperImageHeader");
   count=ReadBlob(image,4,version);
-  offset=(ssize_t) ReadBlobLSBLong(image);
+  offset=(int) ReadBlobLSBLong(image);
   for (i=0; i < (offset+36); i++)
     if (ReadBlobByte(image) == EOF)
       break;
index 8c89750bcd914fef43fac40e3612ffae768a58eb..43a2165d2fc3d6490c4103f67fbe36853946d74e 100644 (file)
@@ -998,16 +998,12 @@ static Image *ReadPSDImage(const ImageInfo *image_info,ExceptionInfo *exception)
             if (image->debug != MagickFalse)
               (void) LogMagickEvent(CoderEvent,GetMagickModule(),
                 "  reading layer #%.20g",(double) i+1);
-            layer_info[i].page.y=(ssize_t) ReadBlobMSBLong(image);
-            layer_info[i].page.x=(ssize_t) ReadBlobMSBLong(image);
+            layer_info[i].page.y=(int) ReadBlobMSBLong(image);
+            layer_info[i].page.x=(int) ReadBlobMSBLong(image);
             layer_info[i].page.height=(size_t)
               (ReadBlobMSBLong(image)-layer_info[i].page.y);
             layer_info[i].page.width=(size_t)
               (ReadBlobMSBLong(image)-layer_info[i].page.x);
-            if (layer_info[i].page.height > 300000)
-              layer_info[i].page.height+=4294967295UL;
-            if (layer_info[i].page.width > 300000)
-              layer_info[i].page.width+=4294967295UL;
             layer_info[i].channels=ReadBlobMSBShort(image);
             if (layer_info[i].channels > MaxPSDChannels)
               ThrowReaderException(CorruptImageError,"MaximumChannelsExceeded");
@@ -1063,16 +1059,12 @@ static Image *ReadPSDImage(const ImageInfo *image_info,ExceptionInfo *exception)
                     /*
                       Layer mask info.
                     */
-                    layer_info[i].mask.y=(ssize_t) ReadBlobMSBLong(image);
-                    layer_info[i].mask.x=(ssize_t) ReadBlobMSBLong(image);
+                    layer_info[i].mask.y=(int) ReadBlobMSBLong(image);
+                    layer_info[i].mask.x=(int) ReadBlobMSBLong(image);
                     layer_info[i].mask.height=(size_t)
                       (ReadBlobMSBLong(image)-layer_info[i].mask.y);
                     layer_info[i].mask.width=(size_t)
                       (ReadBlobMSBLong(image)-layer_info[i].mask.x);
-                    if (layer_info[i].mask.height > 300000)
-                      layer_info[i].mask.height+=4294967295UL;
-                    if (layer_info[i].mask.width > 300000)
-                      layer_info[i].mask.width+=4294967295UL;
                     if (image->debug != MagickFalse)
                       (void) LogMagickEvent(CoderEvent,GetMagickModule(),
                         "      layer mask: offset(%.20g,%.20g), size(%.20g,%.20g), length=%.20g",
index a1a69dc787357b9070e987a6418814a0ba37c3d0..e2864ec44be8f05ad7351887ffa072dbd2dfc73f 100644 (file)
@@ -229,7 +229,7 @@ static Image *ReadRLAImage(const ImageInfo *image_info,ExceptionInfo *exception)
   count=ReadBlob(image,24,(unsigned char *) rla_info.green_primary);
   count=ReadBlob(image,24,(unsigned char *) rla_info.blue_primary);
   count=ReadBlob(image,24,(unsigned char *) rla_info.white_point);
-  rla_info.job_number=(ssize_t) ReadBlobMSBLong(image);
+  rla_info.job_number=(int) ReadBlobMSBLong(image);
   count=ReadBlob(image,128,(unsigned char *) rla_info.name);
   count=ReadBlob(image,128,(unsigned char *) rla_info.description);
   count=ReadBlob(image,64,(unsigned char *) rla_info.program);
@@ -251,7 +251,7 @@ static Image *ReadRLAImage(const ImageInfo *image_info,ExceptionInfo *exception)
   count=ReadBlob(image,36,(unsigned char *) rla_info.space);
   if ((size_t) count != 36)
     ThrowReaderException(CorruptImageError,"UnableToReadImageData");
-  rla_info.next=(ssize_t) ReadBlobMSBLong(image);
+  rla_info.next=(int) ReadBlobMSBLong(image);
   /*
     Initialize image structure.
   */
@@ -272,7 +272,7 @@ static Image *ReadRLAImage(const ImageInfo *image_info,ExceptionInfo *exception)
     Read offsets to each scanline data.
   */
   for (i=0; i < (ssize_t) image->rows; i++)
-    scanlines[i]=(ssize_t) ReadBlobMSBLong(image);
+    scanlines[i]=(int) ReadBlobMSBLong(image);
   /*
     Read image data.
   */
index 074f8d6feb617965c2af7361973c6df0f1a6ba47..59bfda5a7b8a8dd7081925dc19b9bd9d44277833 100644 (file)
@@ -450,7 +450,7 @@ static Image *ReadSGIImage(const ImageInfo *image_info,ExceptionInfo *exception)
             (runlength == (size_t *) NULL))
           ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed");
         for (i=0; i < (ssize_t) (iris_info.rows*iris_info.depth); i++)
-          offsets[i]=(ssize_t) ReadBlobMSBLong(image);
+          offsets[i]=(int) ReadBlobMSBLong(image);
         for (i=0; i < (ssize_t) (iris_info.rows*iris_info.depth); i++)
         {
           runlength[i]=ReadBlobMSBLong(image);
index b84e7c532786e7aa2081d954ac19b646076bfd89..278cfcd1c1100e7194c5c0e8e15f0bfb0e264ad5 100644 (file)
@@ -300,8 +300,8 @@ static Image *ReadVIFFImage(const ImageInfo *image_info,
         viff_info.rows=ReadBlobLSBLong(image);
         viff_info.columns=ReadBlobLSBLong(image);
         viff_info.subrows=ReadBlobLSBLong(image);
-        viff_info.x_offset=(ssize_t) ReadBlobLSBLong(image);
-        viff_info.y_offset=(ssize_t) ReadBlobLSBLong(image);
+        viff_info.x_offset=(int) ReadBlobLSBLong(image);
+        viff_info.y_offset=(int) ReadBlobLSBLong(image);
         viff_info.x_bits_per_pixel=(float) ReadBlobLSBLong(image);
         viff_info.y_bits_per_pixel=(float) ReadBlobLSBLong(image);
         viff_info.location_type=ReadBlobLSBLong(image);
@@ -324,8 +324,8 @@ static Image *ReadVIFFImage(const ImageInfo *image_info,
         viff_info.rows=ReadBlobMSBLong(image);
         viff_info.columns=ReadBlobMSBLong(image);
         viff_info.subrows=ReadBlobMSBLong(image);
-        viff_info.x_offset=(ssize_t) ReadBlobMSBLong(image);
-        viff_info.y_offset=(ssize_t) ReadBlobMSBLong(image);
+        viff_info.x_offset=(int) ReadBlobMSBLong(image);
+        viff_info.y_offset=(int) ReadBlobMSBLong(image);
         viff_info.x_bits_per_pixel=(float) ReadBlobMSBLong(image);
         viff_info.y_bits_per_pixel=(float) ReadBlobMSBLong(image);
         viff_info.location_type=ReadBlobMSBLong(image);
index 8ebd7106842976b88f2c6b9e9e986cba722915cd..4a7873142274821669908375392467b5d51e4d2f 100644 (file)
@@ -830,8 +830,8 @@ static MagickBooleanType ReadOneLayer(Image* image,XCFDocInfo* inDocInfo,
       outLayer->show_mask = ReadBlobMSBLong(image);
       break;
     case PROP_OFFSETS:
-      outLayer->offset_x = (ssize_t) ReadBlobMSBLong(image);
-      outLayer->offset_y = (ssize_t) ReadBlobMSBLong(image);
+      outLayer->offset_x = (int) ReadBlobMSBLong(image);
+      outLayer->offset_y = (int) ReadBlobMSBLong(image);
       break;
     case PROP_MODE:
       outLayer->mode = ReadBlobMSBLong(image);
@@ -1255,7 +1255,7 @@ static Image *ReadXCFImage(const ImageInfo *image_info,ExceptionInfo *exception)
       */
       do
       {
-        ssize_t offset = (ssize_t) ReadBlobMSBLong(image);
+        ssize_t offset = (int) ReadBlobMSBLong(image);
         if (offset == 0)
           foundAllLayers=MagickTrue;
         else
index 3531890221fbab15563aad0a8314b8f6c05b3d57..7b51df5c4852e4a4d0d964e38b5d9b158576a891 100644 (file)
@@ -1892,7 +1892,7 @@ MagickExport MagickBooleanType SyncImageProfiles(Image *image)
   /*
     This the offset to the first IFD.
   */
-  offset=(ssize_t) ReadProfileLong(endian,exif+4);
+  offset=(int) ReadProfileLong(endian,exif+4);
   if ((size_t) offset >= length)
     return(MagickFalse);
   directory=exif+offset;
@@ -1929,7 +1929,7 @@ MagickExport MagickBooleanType SyncImageProfiles(Image *image)
       format=(ssize_t) ReadProfileShort(endian,q+2);
       if ((format-1) >= EXIF_NUM_FORMATS)
         break;
-      components=(ssize_t) ReadProfileLong(endian,q+4);
+      components=(int) ReadProfileLong(endian,q+4);
       number_bytes=(size_t) components*format_bytes[format];
       if (number_bytes <= 4)
         p=q+8;
@@ -1941,7 +1941,7 @@ MagickExport MagickBooleanType SyncImageProfiles(Image *image)
           /*
             The directory entry contains an offset.
           */
-          offset=(ssize_t) ReadProfileLong(endian,q+8);
+          offset=(int) ReadProfileLong(endian,q+8);
           if ((size_t) (offset+number_bytes) > length)
             continue;
           p=(unsigned char *) (exif+offset);
index 3d59d775ab4064238acf6a5b343ba8cfdaa1b1f9..a6a6c9654dfabb50288bb206a80e6d482e00e6db 100644 (file)
@@ -615,7 +615,7 @@ static MagickBooleanType Get8BIMProperty(const Image *image,const char *key)
       }
     if ((count & 0x01) == 0)
       (void) ReadPropertyByte(&info,&length);
-    count=(ssize_t) ReadPropertyMSBLong(&info,&length);
+    count=(int) ReadPropertyMSBLong(&info,&length);
     if ((*name != '\0') && (*name != '#'))
       if ((resource == (char *) NULL) || (LocaleCompare(name,resource) != 0))
         {
@@ -1238,7 +1238,7 @@ static MagickBooleanType GetEXIFProperty(const Image *image,
   /*
     This the offset to the first IFD.
   */
-  offset=(ssize_t) ReadPropertyLong(endian,exif+4);
+  offset=(int) ReadPropertyLong(endian,exif+4);
   if ((size_t) offset >= length)
     return(MagickFalse);
   /*
@@ -1284,7 +1284,7 @@ static MagickBooleanType GetEXIFProperty(const Image *image,
       format=(size_t) ReadPropertyShort(endian,q+2);
       if (format >= (sizeof(tag_bytes)/sizeof(*tag_bytes)))
         break;
-      components=(ssize_t) ReadPropertyLong(endian,q+4);
+      components=(int) ReadPropertyLong(endian,q+4);
       number_bytes=(size_t) components*tag_bytes[format];
       if (number_bytes <= 4)
         p=q+8;
@@ -1296,7 +1296,7 @@ static MagickBooleanType GetEXIFProperty(const Image *image,
           /*
             The directory entry contains an offset.
           */
-          offset=(ssize_t) ReadPropertyLong(endian,q+8);
+          offset=(int) ReadPropertyLong(endian,q+8);
           if ((size_t) (offset+number_bytes) > length)
             continue;
           p=(unsigned char *) (exif+offset);