From 58a749ec1fc5d48a2ea305d892aa6004454bb5ea Mon Sep 17 00:00:00 2001 From: cristy Date: Sun, 25 May 2014 17:36:53 +0000 Subject: [PATCH] --- MagickCore/fx.c | 3 ++- MagickCore/image.c | 3 +-- MagickCore/threshold.c | 2 +- MagickCore/widget.c | 16 ++++++++-------- MagickCore/xwindow.c | 2 ++ MagickWand/mogrify.c | 5 +---- coders/jpeg.c | 6 +++--- 7 files changed, 18 insertions(+), 19 deletions(-) diff --git a/MagickCore/fx.c b/MagickCore/fx.c index 41828353d4..ff295b8946 100644 --- a/MagickCore/fx.c +++ b/MagickCore/fx.c @@ -1410,7 +1410,8 @@ static double FxGetSymbol(FxInfo *fx_info,const PixelChannel channel, length=GetImageListLength(fx_info->images); while (i < 0) i+=(ssize_t) length; - i%=length; + if (length != 0) + i%=length; image=GetImageFromList(fx_info->images,i); if (image == (Image *) NULL) { diff --git a/MagickCore/image.c b/MagickCore/image.c index 642f25f413..24237d598f 100644 --- a/MagickCore/image.c +++ b/MagickCore/image.c @@ -874,7 +874,7 @@ MagickExport Image *CloneImage(const Image *image,const size_t columns, clone_image->ping=image->ping; clone_image->debug=IsEventLogging(); clone_image->semaphore=AcquireSemaphoreInfo(); - if ((columns == 0) && (rows == 0)) + if ((columns == 0) || (rows == 0)) { if (image->montage != (char *) NULL) (void) CloneString(&clone_image->montage,image->montage); @@ -894,7 +894,6 @@ MagickExport Image *CloneImage(const Image *image,const size_t columns, clone_image->columns=columns; clone_image->rows=rows; clone_image->cache=ClonePixelCache(image->cache); - return(clone_image); } diff --git a/MagickCore/threshold.c b/MagickCore/threshold.c index e7f1103bd7..79389ce841 100644 --- a/MagickCore/threshold.c +++ b/MagickCore/threshold.c @@ -1226,7 +1226,7 @@ MagickExport MagickBooleanType ListThresholdMaps(FILE *file, MagickStatusType status; - status=MagickFalse; + status=MagickTrue; if (file == (FILE *) NULL) file=stdout; options=GetConfigureOptions(ThresholdsFilename,exception); diff --git a/MagickCore/widget.c b/MagickCore/widget.c index 3f14ac5cdd..a826db30c4 100644 --- a/MagickCore/widget.c +++ b/MagickCore/widget.c @@ -3025,8 +3025,8 @@ MagickPrivate int XCommandWidget(Display *display,XWindows *windows, } submenu_info=selection_info[i]; submenu_info.active=MagickTrue; - toggle_info.y= - submenu_info.y+(submenu_info.height >> 1)-(toggle_info.height >> 1); + toggle_info.y=submenu_info.y+(submenu_info.height >> 1)- + (toggle_info.height >> 1); id=i; (void) XCheckWindowEvent(display,windows->widget.id,LeaveWindowMask, event); @@ -3165,15 +3165,15 @@ MagickPrivate int XCommandWidget(Display *display,XWindows *windows, selection_info[i].bevel_width--; selection_info[i].height=(unsigned int) ((3*height) >> 1); selection_info[i].x=(QuantumMargin >> 1)+4; - selection_info[i].width=(unsigned int) - (windows->command.width-(selection_info[i].x << 1)); + selection_info[i].width=(unsigned int) (windows->command.width- + (selection_info[i].x << 1)); selection_info[i].y=y; y+=selection_info[i].height+(selection_info[i].bevel_width << 1)+6; } XGetWidgetInfo((char *) NULL,&toggle_info); toggle_info.bevel_width--; - toggle_info.width=(unsigned int) - (((5*height) >> 3)-(toggle_info.bevel_width << 1)); + toggle_info.width=(unsigned int) (((5*height) >> 3)- + (toggle_info.bevel_width << 1)); toggle_info.height=toggle_info.width; toggle_info.x=selection_info[0].x+selection_info[0].width- toggle_info.width-(QuantumMargin >> 1); @@ -3203,8 +3203,8 @@ MagickPrivate int XCommandWidget(Display *display,XWindows *windows, if (i >= (int) windows->command.data) continue; toggle_info.raised=MagickFalse; - toggle_info.y=selection_info[i].y+ - (selection_info[i].height >> 1)-(toggle_info.height >> 1); + toggle_info.y=selection_info[i].y+(selection_info[i].height >> 1)- + (toggle_info.height >> 1); XDrawTriangleEast(display,&windows->command,&toggle_info); } XHighlightWidget(display,&windows->command,BorderOffset,BorderOffset); diff --git a/MagickCore/xwindow.c b/MagickCore/xwindow.c index 7b46aa29c0..e3536488d3 100644 --- a/MagickCore/xwindow.c +++ b/MagickCore/xwindow.c @@ -7163,6 +7163,8 @@ MagickPrivate void XMakeMagnifyImage(Display *display,XWindows *windows, magnify>>=1; while (magnify > windows->magnify.height) magnify>>=1; + if (magnify == 0) + magnify=1; if (magnify != previous_magnify) { Status diff --git a/MagickWand/mogrify.c b/MagickWand/mogrify.c index 48c16c6798..933154d72d 100644 --- a/MagickWand/mogrify.c +++ b/MagickWand/mogrify.c @@ -8613,13 +8613,11 @@ WandExport MagickBooleanType MogrifyImages(ImageInfo *image_info, return(MagickTrue); (void) SetImageInfoProgressMonitor(image_info,(MagickProgressMonitor) NULL, (void *) NULL); - status=0; - + status=MagickTrue; #if 0 (void) FormatLocaleFile(stderr, "mogrify start %s %d (%s)\n",argv[0],argc, post?"post":"pre"); #endif - /* Pre-process multi-image sequence operators */ @@ -8650,7 +8648,6 @@ WandExport MagickBooleanType MogrifyImages(ImageInfo *image_info, (void) FormatLocaleFile(stderr,"mogrify end %ld of %ld\n",(long) GetImageIndexInList(*images),(long)GetImageListLength(*images)); #endif - /* Post-process, multi-image sequence operators */ diff --git a/coders/jpeg.c b/coders/jpeg.c index df06543917..6e85aa76bc 100644 --- a/coders/jpeg.c +++ b/coders/jpeg.c @@ -595,10 +595,10 @@ static boolean ReadIPTCProfile(j_decompress_ptr jpeg_info) for (i=0; i < 4; i++) (void) GetCharacter(jpeg_info); if (length <= 4) - return(MagickTrue); + return(TRUE); length-=4; - if (length == 0) - return(MagickTrue); + if (length <= 7) + return(TRUE); error_manager=(ErrorManager *) jpeg_info->client_data; exception=error_manager->exception; image=error_manager->image;