From: cristy Date: Thu, 1 May 2014 00:42:09 +0000 (+0000) Subject: (no commit message) X-Git-Tag: 7.0.1-0~2376 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4d0ca34912f861b25e5ed95e3f624048cb180358;p=imagemagick --- diff --git a/Magick++/lib/Image.cpp b/Magick++/lib/Image.cpp index 1a261b404..70690504c 100644 --- a/Magick++/lib/Image.cpp +++ b/Magick++/lib/Image.cpp @@ -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; } diff --git a/MagickCore/compare.c b/MagickCore/compare.c index 53e9974dd..ae8f5eadc 100644 --- a/MagickCore/compare.c +++ b/MagickCore/compare.c @@ -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); diff --git a/MagickCore/compress.c b/MagickCore/compress.c index 0a22a0cae..064855ce4 100644 --- a/MagickCore/compress.c +++ b/MagickCore/compress.c @@ -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, diff --git a/MagickCore/draw.c b/MagickCore/draw.c index 30ef126c2..cb33e7a59 100644 --- a/MagickCore/draw.c +++ b/MagickCore/draw.c @@ -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) diff --git a/MagickCore/mime.c b/MagickCore/mime.c index e677aff17..a441bcd67 100644 --- a/MagickCore/mime.c +++ b/MagickCore/mime.c @@ -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); diff --git a/MagickCore/shear.c b/MagickCore/shear.c index 16dd2ff78..56e9ceaf9 100644 --- a/MagickCore/shear.c +++ b/MagickCore/shear.c @@ -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); diff --git a/MagickCore/widget.c b/MagickCore/widget.c index 21676c72a..cd7700180 100644 --- a/MagickCore/widget.c +++ b/MagickCore/widget.c @@ -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; diff --git a/coders/dib.c b/coders/dib.c index d759cd9df..cd310498f 100644 --- a/coders/dib.c +++ b/coders/dib.c @@ -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; diff --git a/coders/djvu.c b/coders/djvu.c index 2604675b8..e04d2663a 100644 --- a/coders/djvu.c +++ b/coders/djvu.c @@ -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); diff --git a/coders/dpx.c b/coders/dpx.c index b6f8431a1..72c7474ea 100644 --- a/coders/dpx.c +++ b/coders/dpx.c @@ -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); diff --git a/coders/fits.c b/coders/fits.c index 3b3889517..519f0084f 100644 --- a/coders/fits.c +++ b/coders/fits.c @@ -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) diff --git a/coders/fpx.c b/coders/fpx.c index 0f9b7564f..65ab06431 100644 --- a/coders/fpx.c +++ b/coders/fpx.c @@ -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) diff --git a/coders/jnx.c b/coders/jnx.c index ca837a069..8f200688c 100644 --- a/coders/jnx.c +++ b/coders/jnx.c @@ -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) diff --git a/coders/jpeg.c b/coders/jpeg.c index bbf3a8381..80a16e00b 100644 --- a/coders/jpeg.c +++ b/coders/jpeg.c @@ -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) { /* diff --git a/coders/mat.c b/coders/mat.c index 2affb3a13..c56789dc6 100644 --- a/coders/mat.c +++ b/coders/mat.c @@ -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); diff --git a/coders/pdf.c b/coders/pdf.c index 0ad52efef..b97d28e67 100644 --- a/coders/pdf.c +++ b/coders/pdf.c @@ -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); } diff --git a/coders/rle.c b/coders/rle.c index c269702ea..a1fb82069 100644 --- a/coders/rle.c +++ b/coders/rle.c @@ -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"); diff --git a/coders/wpg.c b/coders/wpg.c index 6fda5a36a..c9a4f3cbf 100644 --- a/coders/wpg.c +++ b/coders/wpg.c @@ -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;