]> granicus.if.org Git - imagemagick/blobdiff - coders/icon.c
(no commit message)
[imagemagick] / coders / icon.c
index 09af60f87625c02678dfef87e0cedba8a95eac6c..68b36d962777ae42ea64687ffd671f6c7606ec4c 100644 (file)
@@ -17,7 +17,7 @@
 %                                 July 1992                                   %
 %                                                                             %
 %                                                                             %
-%  Copyright 1999-2010 ImageMagick Studio LLC, a non-profit organization      %
+%  Copyright 1999-2011 ImageMagick Studio LLC, a non-profit organization      %
 %  dedicated to making software imaging solutions freely available.           %
 %                                                                             %
 %  You may not use this file except in compliance with the License.  You may  %
@@ -255,8 +255,8 @@ static Image *ReadICONImage(const ImageInfo *image_info,
     if (offset < 0)
       ThrowReaderException(CorruptImageError,"ImproperImageHeader");
     icon_info.size=ReadBlobLSBLong(image);
-    icon_info.width=(unsigned char) ReadBlobLSBLong(image);
-    icon_info.height=(unsigned char) ReadBlobLSBLong(image)/2;
+    icon_info.width=(unsigned char) ((int) ReadBlobLSBLong(image));
+    icon_info.height=(unsigned char) ((int) ReadBlobLSBLong(image)/2);
     if ((icon_file.directory[i].width == 0) && 
         (icon_file.directory[i].height == 0))
       {
@@ -391,6 +391,7 @@ static Image *ReadICONImage(const ImageInfo *image_info,
             break;
         bytes_per_line=(((image->columns*icon_info.bits_per_pixel)+31) &
           ~31) >> 3;
+        (void) bytes_per_line;
         scanline_pad=((((image->columns*icon_info.bits_per_pixel)+31) & ~31)-
           (image->columns*icon_info.bits_per_pixel)) >> 3;
         switch (icon_info.bits_per_pixel)
@@ -571,7 +572,8 @@ static Image *ReadICONImage(const ImageInfo *image_info,
           default:
             ThrowReaderException(CorruptImageError,"ImproperImageHeader");
         }
-        (void) SyncImage(image);
+        if (image_info->ping == MagickFalse)
+          (void) SyncImage(image);
         if (icon_info.bits_per_pixel != 32)
           {
             /*
@@ -1216,6 +1218,7 @@ static MagickBooleanType WriteICONImage(const ImageInfo *image_info,
       break;
   } while ((next != (Image *) NULL) && (image_info->adjoin != MagickFalse));
   offset=SeekBlob(image,0,SEEK_SET);
+  (void) offset;
   (void) WriteBlobLSBShort(image,0);
   (void) WriteBlobLSBShort(image,1);
   (void) WriteBlobLSBShort(image,(unsigned short) (scene+1));