]> granicus.if.org Git - imagemagick/commitdiff
(no commit message)
authorcristy <urban-warrior@git.imagemagick.org>
Thu, 1 May 2014 00:42:09 +0000 (00:42 +0000)
committercristy <urban-warrior@git.imagemagick.org>
Thu, 1 May 2014 00:42:09 +0000 (00:42 +0000)
18 files changed:
Magick++/lib/Image.cpp
MagickCore/compare.c
MagickCore/compress.c
MagickCore/draw.c
MagickCore/mime.c
MagickCore/shear.c
MagickCore/widget.c
coders/dib.c
coders/djvu.c
coders/dpx.c
coders/fits.c
coders/fpx.c
coders/jnx.c
coders/jpeg.c
coders/mat.c
coders/pdf.c
coders/rle.c
coders/wpg.c

index 1a261b4043ebc9eb3b8ce766b00b01d8682aa893..70690504cd1c919b8adffcc718932db1e527e09b 100644 (file)
@@ -590,7 +590,7 @@ void Magick::Image::colorMapSize(const size_t entries_)
 
   modifyImage();
   GetPPException;
-  AcquireImageColormap(image(),entries_,&exceptionInfo);
+  (void) AcquireImageColormap(image(),entries_,&exceptionInfo);
   ThrowPPException;
 }
 
@@ -2768,7 +2768,7 @@ void Magick::Image::erase(void)
 {
   modifyImage();
   GetPPException;
-  SetImageBackgroundColor(image(),&exceptionInfo);
+  (void) SetImageBackgroundColor(image(),&exceptionInfo);
   ThrowPPException;
 }
 
@@ -4468,7 +4468,7 @@ void Magick::Image::swirl(const double degrees_)
 void Magick::Image::syncPixels(void)
 {
   GetPPException;
-  (*SyncAuthenticPixels)(image(),&exceptionInfo);
+  (void) (*SyncAuthenticPixels)(image(),&exceptionInfo);
   ThrowPPException;
 }
 
index 53e9974ddbc2720e5e8a6fab78c6f3073a7500e8..ae8f5eadc450db1f097dc00b58b6594eada2c253 100644 (file)
@@ -1129,7 +1129,7 @@ static MagickBooleanType GetPerceptualHashDistortion(const Image *image,
   if (image_phash == (ChannelPerceptualHash *) NULL)
     return(MagickFalse);
   reconstruct_phash=GetImagePerceptualHash(reconstruct_image,exception);
-  if (image_phash == (ChannelPerceptualHash *) NULL)
+  if (reconstruct_phash == (ChannelPerceptualHash *) NULL)
     {
       image_phash=(ChannelPerceptualHash *) RelinquishMagickMemory(image_phash);
       return(MagickFalse);
index 0a22a0cae1e049a10507497c005b2c23aae97f26..064855ce4f4d1db5d2e0e16976dd2891fc250006 100644 (file)
@@ -1285,11 +1285,10 @@ MagickExport MagickBooleanType ZLIBEncodeImage(Image *image,const size_t length,
     }
   if (status != Z_OK)
     ThrowBinaryException(CoderError,"UnableToZipCompressImage",image->filename)
-  else
-    for (i=0; i < (ssize_t) compress_packets; i++)
-      (void) WriteBlobByte(image,compress_pixels[i]);
+  for (i=0; i < (ssize_t) compress_packets; i++)
+    (void) WriteBlobByte(image,compress_pixels[i]);
   compress_pixels=(unsigned char *) RelinquishMagickMemory(compress_pixels);
-  return(status == Z_OK ? MagickTrue : MagickFalse);
+  return(MagickTrue);
 }
 #else
 MagickExport MagickBooleanType ZLIBEncodeImage(Image *image,
index 30ef126c296e7890f780a62f2c5df55d21cc2846..cb33e7a59e70b7c185f3c56816eb0a70f629c0ba 100644 (file)
@@ -1536,7 +1536,7 @@ static MagickBooleanType DrawDashPolygon(const DrawInfo *draw_info,
       {
         offset-=length;
         n++;
-        length=scale*(draw_info->dash_pattern[n]+(n == 0 ? -0.5 : 0.5));
+        length=scale*(draw_info->dash_pattern[n]+0.5);
         continue;
       }
     if (offset < length)
index e677aff17c20babcf9c856a536fb804d442a824a..a441bcd6758f3adc757fc5f5385319a8c497f5db 100644 (file)
@@ -382,7 +382,7 @@ MagickExport const MimeInfo *GetMimeInfo(const char *filename,
     }
     p=(const MimeInfo *) GetNextValueInLinkedList(mime_cache);
   }
-  if (p != (const MimeInfo *) NULL)
+  if (mime_info != (const MimeInfo *) NULL)
     (void) InsertValueInLinkedList(mime_cache,0,
       RemoveElementByValueFromLinkedList(mime_cache,p));
   UnlockSemaphoreInfo(mime_semaphore);
index 16dd2ff7833a8a89e8d040cf80ef0ce5d9743fc9..56e9ceaf9dd62e0f1f1ee1e1e871310ee56861a7 100644 (file)
@@ -759,13 +759,6 @@ MagickExport Image *IntegralRotateImage(const Image *image,size_t rotations,
   rotate_view=AcquireAuthenticCacheView(rotate_image,exception);
   switch (rotations)
   {
-    case 0:
-    {
-      /*
-        Rotate 0 degrees.
-      */
-      break;
-    }
     case 1:
     {
       size_t
@@ -1104,6 +1097,8 @@ MagickExport Image *IntegralRotateImage(const Image *image,size_t rotations,
         page.x=(ssize_t) (page.width-rotate_image->columns-page.x);
       break;
     }
+    default:
+      break;
   }
   rotate_view=DestroyCacheView(rotate_view);
   image_view=DestroyCacheView(image_view);
index 21676c72a38ffd4f171ea3de2c77a41305c675fa..cd77001808afef9a4d5ef36b266b36eca0acbe76 100644 (file)
@@ -3591,7 +3591,7 @@ MagickPrivate int XConfirmWidget(Display *display,XWindows *windows,
             /*
               Dismiss button status changed.
             */
-            dismiss_info.raised=cancel_info.raised == MagickFalse ?
+            dismiss_info.raised=dismiss_info.raised == MagickFalse ?
               MagickTrue : MagickFalse;
             XDrawBeveledButton(display,&windows->widget,&dismiss_info);
             break;
index d759cd9dfed88a6d3505cddddc8a354529620d73..cd310498f2af1de60a260454a969c52b31cf7030 100644 (file)
@@ -1220,7 +1220,7 @@ static MagickBooleanType WriteDIBImage(const ImageInfo *image_info,Image *image,
         length=2UL*(bytes_per_line+2UL)+2UL;
         dib_data=(unsigned char *) AcquireQuantumMemory(length,
           (image->rows+2UL)*sizeof(*dib_data));
-        if (pixels == (unsigned char *) NULL)
+        if (dib_data == (unsigned char *) NULL)
           {
             pixels=(unsigned char *) RelinquishMagickMemory(pixels);
             ThrowWriterException(ResourceLimitError,"MemoryAllocationFailed");
@@ -1256,7 +1256,7 @@ static MagickBooleanType WriteDIBImage(const ImageInfo *image_info,Image *image,
             Dump colormap to file.
           */
           dib_colormap=(unsigned char *) AcquireQuantumMemory((size_t)
-            (1UL << dib_info.bits_per_pixel),4*sizeof(dib_colormap));
+            (1UL << dib_info.bits_per_pixel),4*sizeof(*dib_colormap));
           if (dib_colormap == (unsigned char *) NULL)
             ThrowWriterException(ResourceLimitError,"MemoryAllocationFailed");
           q=dib_colormap;
index 2604675b8471bbe7ab370caa9e8f67eca0eaacce..e04d2663a2306e7b4f696364cd80a57466818909 100644 (file)
@@ -448,7 +448,7 @@ get_page_image(LoadContext *lc, ddjvu_page_t *page, int x, int y, int w, int h,
                     r+=GetPixelChannels(image);
                   }
 
-                              SyncAuthenticPixels(image,exception);
+                              (void) SyncAuthenticPixels(image,exception);
                         }
         }
         q=(unsigned char *) RelinquishMagickMemory(q);
index b6f8431a12e4b39b2737c9aaa87e496458a9e82e..72c7474ea0012a2065896efa2cc5f1841e9a9d9b 100644 (file)
@@ -926,7 +926,7 @@ static Image *ReadDPXImage(const ImageInfo *image_info,ExceptionInfo *exception)
         Read DPX film header.
       */
       offset+=ReadBlob(image,sizeof(dpx.film.id),(unsigned char *) dpx.film.id);
-      if (*dpx.film.type != '\0')
+      if (*dpx.film.id != '\0')
         (void) FormatImageProperty(image,"dpx:film.id","%.2s",dpx.film.id);
       offset+=ReadBlob(image,sizeof(dpx.film.type),(unsigned char *)
         dpx.film.type);
index 3b3889517ec3bea86c5f3cfb31d6bf6032af80f4..519f0084f57b2fabd5a71ba97bb4d18ca8c5173c 100644 (file)
@@ -167,8 +167,8 @@ static inline double GetFITSPixel(Image *image,int bits_per_pixel)
   return(ReadBlobDouble(image));
 }
 
-static void GetFITSPixelExtrema(Image *image,const int bits_per_pixel,
-  double *minima,double *maxima)
+static MagickOffsetType GetFITSPixelExtrema(Image *image,
+  const int bits_per_pixel,double *minima,double *maxima)
 {
   double
     pixel;
@@ -183,6 +183,8 @@ static void GetFITSPixelExtrema(Image *image,const int bits_per_pixel,
     i;
 
   offset=TellBlob(image);
+  if (offset == -1)
+    return(-1);
   number_pixels=(MagickSizeType) image->columns*image->rows;
   *minima=GetFITSPixel(image,bits_per_pixel);
   *maxima=(*minima);
@@ -194,7 +196,7 @@ static void GetFITSPixelExtrema(Image *image,const int bits_per_pixel,
     if (pixel > *maxima)
       *maxima=pixel;
   }
-  (void) SeekBlob(image,offset,SEEK_SET);
+  return(SeekBlob(image,offset,SEEK_SET));
 }
 
 static inline double GetFITSPixelRange(const size_t depth)
@@ -428,7 +430,7 @@ static Image *ReadFITSImage(const ImageInfo *image_info,
     if ((fits_info.min_data == 0.0) && (fits_info.max_data == 0.0))
       {
         if (fits_info.zero == 0.0)
-          GetFITSPixelExtrema(image,fits_info.bits_per_pixel,
+          (void) GetFITSPixelExtrema(image,fits_info.bits_per_pixel,
             &fits_info.min_data,&fits_info.max_data);
         else
           fits_info.max_data=GetFITSPixelRange((size_t)
index 0f9b7564f57add82ed02a7f4c38b969c8e3b78e8..65ab06431d1e789867cb2c9c5f0a0bbfc934cb9d 100644 (file)
@@ -1039,7 +1039,7 @@ static MagickBooleanType WriteFPXImage(const ImageInfo *image_info,Image *image,
         Initialize default viewing parameters.
       */
       contrast=1.0;
-      contrast_valid=MagickFalse;
+      contrast_valid=MagickTrue;
       color_twist.byy=1.0;
       color_twist.byc1=0.0;
       color_twist.byc2=0.0;
@@ -1056,16 +1056,16 @@ static MagickBooleanType WriteFPXImage(const ImageInfo *image_info,Image *image,
       color_twist.dummy5_zero=0.0;
       color_twist.dummy6_zero=0.0;
       color_twist.dummy7_one=1.0;
-      color_twist_valid=MagickFalse;
+      color_twist_valid=MagickTrue;
       sharpen=0.0;
-      sharpen_valid=MagickFalse;
+      sharpen_valid=MagickTrue;
       aspect_ratio=(double) image->columns/image->rows;
-      aspect_ratio_valid=MagickFalse;
+      aspect_ratio_valid=MagickTrue;
       view_rect.left=(float) 0.1;
       view_rect.width=aspect_ratio-0.2;
       view_rect.top=(float) 0.1;
       view_rect.height=(float) 0.8; /* 1.0-0.2 */
-      view_rect_valid=MagickFalse;
+      view_rect_valid=MagickTrue;
       affine.a11=1.0;
       affine.a12=0.0;
       affine.a13=0.0;
@@ -1082,7 +1082,7 @@ static MagickBooleanType WriteFPXImage(const ImageInfo *image_info,Image *image,
       affine.a42=0.0;
       affine.a43=0.0;
       affine.a44=1.0;
-      affine_valid=MagickFalse;
+      affine_valid=MagickTrue;
       if (0)
         {
           /*
@@ -1093,37 +1093,37 @@ static MagickBooleanType WriteFPXImage(const ImageInfo *image_info,Image *image,
           SetColorBalance(0.5,1.0,1.0,&color_twist);
           color_twist_valid=MagickTrue;
         }
-      if (affine_valid)
+      if (affine_valid != MagickFalse)
         {
           fpx_status=FPX_SetImageAffineMatrix(flashpix,&affine);
           if (fpx_status != FPX_OK)
             ThrowWriterException(DelegateError,"UnableToSetAffineMatrix");
         }
-      if (aspect_ratio_valid)
+      if (aspect_ratio_valid != MagickFalse)
         {
           fpx_status=FPX_SetImageResultAspectRatio(flashpix,&aspect_ratio);
           if (fpx_status != FPX_OK)
             ThrowWriterException(DelegateError,"UnableToSetAspectRatio");
         }
-      if (color_twist_valid)
+      if (color_twist_valid != MagickFalse)
         {
           fpx_status=FPX_SetImageColorTwistMatrix(flashpix,&color_twist);
           if (fpx_status != FPX_OK)
             ThrowWriterException(DelegateError,"UnableToSetColorTwist");
         }
-      if (contrast_valid)
+      if (contrast_valid != MagickFalse)
         {
           fpx_status=FPX_SetImageContrastAdjustment(flashpix,&contrast);
           if (fpx_status != FPX_OK)
             ThrowWriterException(DelegateError,"UnableToSetContrast");
         }
-      if (sharpen_valid)
+      if (sharpen_valid != MagickFalse)
         {
           fpx_status=FPX_SetImageFilteringValue(flashpix,&sharpen);
           if (fpx_status != FPX_OK)
             ThrowWriterException(DelegateError,"UnableToSetFilteringValue");
         }
-      if (view_rect_valid)
+      if (view_rect_valid != MagickFalse)
         {
           fpx_status=FPX_SetImageROI(flashpix,&view_rect);
           if (fpx_status != FPX_OK)
index ca837a06981ec2984b640aa1fa7ed1b24767a6d0..8f200688cb746bdd1493031796e961ab0f525e98 100644 (file)
@@ -267,6 +267,8 @@ static Image *ReadJNXImage(const ImageInfo *image_info,ExceptionInfo *exception)
       (void) ReadBlobLSBShort(image); /* height */
       tile_length=ReadBlobLSBLong(image);
       tile_offset=(int) ReadBlobLSBLong(image);
+      if (tile_offset == -1)
+        continue;
       restore_offset=TellBlob(image);
       offset=SeekBlob(image,(MagickOffsetType) tile_offset,SEEK_SET);
       if (offset != (MagickOffsetType) tile_offset)
index bbf3a838106f734aeaee5f6c5ac33c563e7c23a7..80a16e00b622c7fd599707ffab49c5ab84ddf4fa 100644 (file)
@@ -577,9 +577,9 @@ static boolean ReadIPTCProfile(j_decompress_ptr jpeg_info)
   for (i=0; i < 10; i++)
     magick[i]=(char) GetCharacter(jpeg_info);
   magick[10]='\0';
+  length-=10;
   if (length <= 10)
     return(TRUE);
-  length-=10;
   if (LocaleCompare(magick,"Photoshop ") != 0)
     {
       /*
index 2affb3a13a89c054d15fc3d423a6a963b2965d23..c56789dc63d73e7eaef3c3624164ab503787f9f9 100644 (file)
@@ -500,7 +500,10 @@ int status;
     return NULL;
   }
 
-  mat_file = fdopen(AcquireUniqueFileResource(clone_info->filename),"w");
+  mat_file=0;
+  file = AcquireUniqueFileResource(clone_info->filename);
+  if (file != -1)
+    mat_file = fdopen(file,"w");
   if(!mat_file)
   {
     RelinquishMagickMemory(CacheBlock);
index 0ad52efef3a38fc0f43da64a03056b7f5dca3cd4..b97d28e6756f0149474b8251276b2b21e652ccca 100644 (file)
@@ -2241,7 +2241,7 @@ RestoreMSCWarning
                 *q++=ScaleQuantumToChar(GetPixelRed(tile_image,p));
                 *q++=ScaleQuantumToChar(GetPixelGreen(tile_image,p));
                 *q++=ScaleQuantumToChar(GetPixelBlue(tile_image,p));
-                if (image->colorspace == CMYKColorspace)
+                if (tile_image->colorspace == CMYKColorspace)
                   *q++=ScaleQuantumToChar(GetPixelBlack(tile_image,p));
                 p+=GetPixelChannels(tile_image);
               }
index c269702eace192e047e4b7634451cc18abe981b8..a1fb820694bd030bd7880a16529c745b07d72a29 100644 (file)
@@ -220,7 +220,7 @@ static Image *ReadRLEImage(const ImageInfo *image_info,ExceptionInfo *exception)
     bits_per_pixel=1UL*ReadBlobByte(image);
     number_colormaps=1UL*ReadBlobByte(image);
     one=1;
-    map_length=one << ReadBlobByte(image);
+    map_length=one << (unsigned char) ReadBlobByte(image);
     if ((number_planes == 0) || (number_planes == 2) || (bits_per_pixel != 8) ||
         (image->columns == 0))
       ThrowReaderException(CorruptImageError,"ImproperImageHeader");
index 6fda5a36a5f5346fb5efdaa273c13f1dbf516c93..c9a4f3cbff09d193eeecd39a202fb2cceccc199e 100644 (file)
@@ -743,7 +743,7 @@ static Image *ExtractPostscript(Image *image,const ImageInfo *image_info,
   clone_info->length=0;
 
   /* Obtain temporary file */
-  AcquireUniqueFilename(postscript_file);
+  (void) AcquireUniqueFilename(postscript_file);
   ps_file=fopen_utf8(postscript_file,"wb");
   if (ps_file == (FILE *) NULL)
     goto FINISH;