From: cristy Date: Fri, 3 May 2013 13:39:25 +0000 (+0000) Subject: (no commit message) X-Git-Tag: 7.0.1-0~3749 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b0de93fdedaac769cb08e15b3ec176d4c9078907;p=imagemagick --- diff --git a/MagickCore/colorspace.c b/MagickCore/colorspace.c index 44ccdeb9c..8c6f108d5 100644 --- a/MagickCore/colorspace.c +++ b/MagickCore/colorspace.c @@ -82,7 +82,7 @@ typedef struct _TransformPacket Forward declarations. */ static MagickBooleanType - TransformsRGBImage(Image *,const ColorspaceType,ExceptionInfo *); + TransformsRGBImage(Image *,ExceptionInfo *); /* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -1907,10 +1907,10 @@ MagickExport MagickBooleanType TransformImageColorspace(Image *image, (void) DeleteImageProfile(image,"icc"); (void) DeleteImageProfile(image,"icm"); if (IssRGBColorspace(colorspace) != MagickFalse) - return(TransformsRGBImage(image,colorspace,exception)); + return(TransformsRGBImage(image,exception)); status=MagickTrue; if (IssRGBColorspace(image->colorspace) == MagickFalse) - status=TransformsRGBImage(image,image->colorspace,exception); + status=TransformsRGBImage(image,exception); if (status == MagickFalse) return(status); /* @@ -1940,14 +1940,12 @@ MagickExport MagickBooleanType TransformImageColorspace(Image *image, % The format of the TransformsRGBImage method is: % % MagickBooleanType TransformsRGBImage(Image *image, -% const ColorspaceType colorspace,ExceptionInfo *exception) +% ExceptionInfo *exception) % % A description of each parameter follows: % % o image: the image. % -% o colorspace: the colorspace to transform the image to. -% % o exception: return any errors or warnings in this structure. % */ @@ -1991,7 +1989,7 @@ static inline void ConvertCMYKToRGB(PixelInfo *pixel) } static MagickBooleanType TransformsRGBImage(Image *image, - const ColorspaceType colorspace,ExceptionInfo *exception) + ExceptionInfo *exception) { #define TransformsRGBImageTag "Transform/Image" diff --git a/MagickCore/compress.c b/MagickCore/compress.c index f639a050e..f8ecb9620 100644 --- a/MagickCore/compress.c +++ b/MagickCore/compress.c @@ -968,6 +968,8 @@ MagickExport MagickBooleanType LZWEncodeImage(Image *image,const size_t length, if (image->debug != MagickFalse) (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename); assert(pixels != (unsigned char *) NULL); + assert(exception != (ExceptionInfo *) NULL); + assert(exception->signature == MagickSignature); table=(TableType *) AcquireQuantumMemory(1UL << 12,sizeof(*table)); if (table == (TableType *) NULL) return(MagickFalse); diff --git a/MagickCore/distribute-cache.c b/MagickCore/distribute-cache.c index 7ce6cc5bb..e65a90825 100644 --- a/MagickCore/distribute-cache.c +++ b/MagickCore/distribute-cache.c @@ -394,6 +394,7 @@ static MagickBooleanType DestroyDistributeCache(SplayTreeInfo *registry, /* Destroy distributed pixel cache. */ + (void) file; return(DeleteNodeFromSplayTree(registry,(const void *) session_key)); } @@ -875,6 +876,8 @@ MagickExport void DistributePixelCacheServer(const int port, /* Launch distributed pixel cache server. */ + assert(exception != (ExceptionInfo *) NULL); + assert(exception->signature == MagickSignature); (void) ResetMagickMemory(&hint,0,sizeof(hint)); hint.ai_family=AF_INET; hint.ai_socktype=SOCK_STREAM; diff --git a/MagickCore/effect.c b/MagickCore/effect.c index fc7e0aefb..69d6d9af6 100644 --- a/MagickCore/effect.c +++ b/MagickCore/effect.c @@ -924,6 +924,10 @@ static void Hull(const Image *image,const ssize_t x_offset, ssize_t y; + assert(image != (const Image *) NULL); + assert(image->signature == MagickSignature); + if (image->debug != MagickFalse) + (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename); assert(f != (Quantum *) NULL); assert(g != (Quantum *) NULL); p=f+(columns+2); diff --git a/MagickCore/quantize.c b/MagickCore/quantize.c index ba864706a..83a8e661d 100644 --- a/MagickCore/quantize.c +++ b/MagickCore/quantize.c @@ -454,9 +454,8 @@ static inline void AssociateAlphaPixel(const Image *image, alpha_pixel->alpha=(double) GetPixelAlpha(image,pixel); } -static inline void AssociateAlphaPixelInfo(const Image *image, - const CubeInfo *cube_info,const PixelInfo *pixel, - RealPixelInfo *alpha_pixel) +static inline void AssociateAlphaPixelInfo(const CubeInfo *cube_info, + const PixelInfo *pixel,RealPixelInfo *alpha_pixel) { double alpha; @@ -1636,7 +1635,7 @@ static MagickBooleanType FloydSteinbergDither(Image *image,CubeInfo *cube_info, /* Store the error. */ - AssociateAlphaPixelInfo(image,&cube,image->colormap+index,&color); + AssociateAlphaPixelInfo(&cube,image->colormap+index,&color); current[u].red=pixel.red-color.red; current[u].green=pixel.green-color.green; current[u].blue=pixel.blue-color.blue; @@ -1895,7 +1894,7 @@ static MagickBooleanType RiemersmaDither(Image *image,CacheView *image_view, */ (void) CopyMagickMemory(p->error,p->error+1,(ErrorQueueLength-1)* sizeof(p->error[0])); - AssociateAlphaPixelInfo(image,cube_info,image->colormap+index,&color); + AssociateAlphaPixelInfo(cube_info,image->colormap+index,&color); p->error[ErrorQueueLength-1].red=pixel.red-color.red; p->error[ErrorQueueLength-1].green=pixel.green-color.green; p->error[ErrorQueueLength-1].blue=pixel.blue-color.blue; diff --git a/MagickCore/quantum-export.c b/MagickCore/quantum-export.c index d59f146d1..9a5ec0651 100644 --- a/MagickCore/quantum-export.c +++ b/MagickCore/quantum-export.c @@ -244,6 +244,8 @@ static void ExportAlphaQuantum(const Image *image,QuantumInfo *quantum_info, register ssize_t x; + assert(exception != (ExceptionInfo *) NULL); + assert(exception->signature == MagickSignature); switch (quantum_info->depth) { case 8: @@ -350,6 +352,8 @@ static void ExportBGRQuantum(const Image *image,QuantumInfo *quantum_info, ssize_t bit; + assert(exception != (ExceptionInfo *) NULL); + assert(exception->signature == MagickSignature); switch (quantum_info->depth) { case 8: @@ -644,6 +648,8 @@ static void ExportBGRAQuantum(const Image *image,QuantumInfo *quantum_info, register ssize_t x; + assert(exception != (ExceptionInfo *) NULL); + assert(exception->signature == MagickSignature); switch (quantum_info->depth) { case 8: @@ -995,6 +1001,8 @@ static void ExportBlueQuantum(const Image *image,QuantumInfo *quantum_info, register ssize_t x; + assert(exception != (ExceptionInfo *) NULL); + assert(exception->signature == MagickSignature); switch (quantum_info->depth) { case 8: @@ -1108,6 +1116,8 @@ static void ExportCbYCrYQuantum(const Image *image,QuantumInfo *quantum_info, ssize_t n; + assert(exception != (ExceptionInfo *) NULL); + assert(exception->signature == MagickSignature); n=0; quantum=0; switch (quantum_info->depth) @@ -1521,6 +1531,8 @@ static void ExportGrayQuantum(const Image *image,QuantumInfo *quantum_info, register ssize_t x; + assert(exception != (ExceptionInfo *) NULL); + assert(exception->signature == MagickSignature); switch (quantum_info->depth) { case 1: @@ -1777,6 +1789,8 @@ static void ExportGrayAlphaQuantum(const Image *image,QuantumInfo *quantum_info, register ssize_t x; + assert(exception != (ExceptionInfo *) NULL); + assert(exception->signature == MagickSignature); switch (quantum_info->depth) { case 1: @@ -1981,6 +1995,8 @@ static void ExportGreenQuantum(const Image *image,QuantumInfo *quantum_info, register ssize_t x; + assert(exception != (ExceptionInfo *) NULL); + assert(exception->signature == MagickSignature); switch (quantum_info->depth) { case 8: @@ -2446,6 +2462,8 @@ static void ExportOpacityQuantum(const Image *image,QuantumInfo *quantum_info, register ssize_t x; + assert(exception != (ExceptionInfo *) NULL); + assert(exception->signature == MagickSignature); switch (quantum_info->depth) { case 8: @@ -2549,6 +2567,8 @@ static void ExportRedQuantum(const Image *image,QuantumInfo *quantum_info, register ssize_t x; + assert(exception != (ExceptionInfo *) NULL); + assert(exception->signature == MagickSignature); switch (quantum_info->depth) { case 8: @@ -2655,6 +2675,8 @@ static void ExportRGBQuantum(const Image *image,QuantumInfo *quantum_info, ssize_t bit; + assert(exception != (ExceptionInfo *) NULL); + assert(exception->signature == MagickSignature); switch (quantum_info->depth) { case 8: @@ -2949,6 +2971,8 @@ static void ExportRGBAQuantum(const Image *image,QuantumInfo *quantum_info, register ssize_t x; + assert(exception != (ExceptionInfo *) NULL); + assert(exception->signature == MagickSignature); switch (quantum_info->depth) { case 8: diff --git a/MagickCore/quantum-import.c b/MagickCore/quantum-import.c index f28039745..17642c19b 100644 --- a/MagickCore/quantum-import.c +++ b/MagickCore/quantum-import.c @@ -264,6 +264,8 @@ static void ImportAlphaQuantum(const Image *image,QuantumInfo *quantum_info, unsigned int pixel; + assert(image != (Image *) NULL); + assert(image->signature == MagickSignature); switch (quantum_info->depth) { case 8: @@ -382,6 +384,8 @@ static void ImportBGRQuantum(const Image *image,QuantumInfo *quantum_info, unsigned int pixel; + assert(image != (Image *) NULL); + assert(image->signature == MagickSignature); switch (quantum_info->depth) { case 8: @@ -688,6 +692,8 @@ static void ImportBGRAQuantum(const Image *image,QuantumInfo *quantum_info, unsigned int pixel; + assert(image != (Image *) NULL); + assert(image->signature == MagickSignature); switch (quantum_info->depth) { case 8: @@ -1041,6 +1047,8 @@ static void ImportBlueQuantum(const Image *image,QuantumInfo *quantum_info, unsigned int pixel; + assert(image != (Image *) NULL); + assert(image->signature == MagickSignature); switch (quantum_info->depth) { case 8: @@ -1156,6 +1164,8 @@ static void ImportCbYCrYQuantum(const Image *image,QuantumInfo *quantum_info, unsigned int pixel; + assert(image != (Image *) NULL); + assert(image->signature == MagickSignature); switch (quantum_info->depth) { case 10: @@ -1597,6 +1607,8 @@ static void ImportGrayQuantum(const Image *image,QuantumInfo *quantum_info, unsigned int pixel; + assert(image != (Image *) NULL); + assert(image->signature == MagickSignature); switch (quantum_info->depth) { case 1: @@ -1909,6 +1921,8 @@ static void ImportGrayAlphaQuantum(const Image *image,QuantumInfo *quantum_info, unsigned int pixel; + assert(image != (Image *) NULL); + assert(image->signature == MagickSignature); switch (quantum_info->depth) { case 1: @@ -2114,6 +2128,8 @@ static void ImportGreenQuantum(const Image *image,QuantumInfo *quantum_info, unsigned int pixel; + assert(image != (Image *) NULL); + assert(image->signature == MagickSignature); switch (quantum_info->depth) { case 8: @@ -2655,6 +2671,8 @@ static void ImportOpacityQuantum(const Image *image,QuantumInfo *quantum_info, unsigned int pixel; + assert(image != (Image *) NULL); + assert(image->signature == MagickSignature); switch (quantum_info->depth) { case 8: @@ -2770,6 +2788,8 @@ static void ImportRedQuantum(const Image *image,QuantumInfo *quantum_info, unsigned int pixel; + assert(image != (Image *) NULL); + assert(image->signature == MagickSignature); switch (quantum_info->depth) { case 8: @@ -2888,6 +2908,8 @@ static void ImportRGBQuantum(const Image *image,QuantumInfo *quantum_info, unsigned int pixel; + assert(image != (Image *) NULL); + assert(image->signature == MagickSignature); switch (quantum_info->depth) { case 8: @@ -3194,6 +3216,8 @@ static void ImportRGBAQuantum(const Image *image,QuantumInfo *quantum_info, unsigned int pixel; + assert(image != (Image *) NULL); + assert(image->signature == MagickSignature); switch (quantum_info->depth) { case 8: diff --git a/MagickCore/shear.c b/MagickCore/shear.c index d8b7881d9..143e002eb 100644 --- a/MagickCore/shear.c +++ b/MagickCore/shear.c @@ -536,6 +536,7 @@ static void RadonProjection(const Image *image,RadonInfo *source_cells, size_t step; + assert(image != (Image *) NULL); p=source_cells; q=destination_cells; for (step=1; step < p->width; step*=2) diff --git a/MagickCore/statistic.c b/MagickCore/statistic.c index 415f48328..d4b852487 100644 --- a/MagickCore/statistic.c +++ b/MagickCore/statistic.c @@ -2315,8 +2315,7 @@ static inline void GetStandardDeviationPixelList(PixelList *pixel_list, *pixel=ScaleShortToQuantum((unsigned short) sqrt(sum_squared-(sum*sum))); } -static inline void InsertPixelList(const Image *image,const Quantum pixel, - PixelList *pixel_list) +static inline void InsertPixelList(const Quantum pixel,PixelList *pixel_list) { size_t signature; @@ -2496,7 +2495,7 @@ MagickExport Image *StatisticImage(const Image *image,const StatisticType type, { for (u=0; u < (ssize_t) MagickMax(width,1); u++) { - InsertPixelList(image,pixels[i],pixel_list[id]); + InsertPixelList(pixels[i],pixel_list[id]); pixels+=GetPixelChannels(image); } pixels+=(image->columns-1)*GetPixelChannels(image); diff --git a/MagickCore/string.c b/MagickCore/string.c index bbaaf716a..86692e5b3 100644 --- a/MagickCore/string.c +++ b/MagickCore/string.c @@ -2291,6 +2291,8 @@ MagickExport double *StringToArrayOfDoubles(const char *string,ssize_t *count, /* Determine count of values, and check syntax. */ + assert(exception != (ExceptionInfo *) NULL); + assert(exception->signature == MagickSignature); *count=0; i=0; p=string; diff --git a/coders/djvu.c b/coders/djvu.c index 8dfec8a09..f8c151acf 100644 --- a/coders/djvu.c +++ b/coders/djvu.c @@ -322,7 +322,7 @@ process_message(ddjvu_message_t *message) * we use the RGB format! */ static void -get_page_image(LoadContext *lc, ddjvu_page_t *page, int x, int y, int w, int h, const ImageInfo *image_info, ExceptionInfo *exception ) { +get_page_image(LoadContext *lc, ddjvu_page_t *page, int x, int y, int w, int h, ExceptionInfo *exception ) { ddjvu_format_t *format; @@ -674,8 +674,7 @@ static Image *ReadOneDJVUImage(LoadContext* lc,const int pagenum, #if 1 /* per_line */ /* q = QueueAuthenticPixels(image,0,0,image->columns,image->rows); */ - get_page_image(lc, lc->page, 0, 0, info.width, info.height, image_info, - exception); + get_page_image(lc, lc->page, 0, 0, info.width, info.height, exception); #else int i; for (i = 0;i< image->rows; i++) diff --git a/coders/palm.c b/coders/palm.c index 6fd60fb36..83abfedbc 100644 --- a/coders/palm.c +++ b/coders/palm.c @@ -180,7 +180,7 @@ static MagickBooleanType % % The format of the FindColor method is: % -% int FindColor(const Image *image,PixelInfo *pixel) +% int FindColor(PixelInfo *pixel) % % A description of each parameter follows: % @@ -189,7 +189,7 @@ static MagickBooleanType % o pixel: a pointer to the PixelInfo to be matched. % */ -static int FindColor(const Image *image,PixelInfo *packet) +static int FindColor(PixelInfo *packet) { register ssize_t i; @@ -825,7 +825,7 @@ static MagickBooleanType WritePALMImage(const ImageInfo *image_info, q=GetAuthenticPixels(image,0,y,image->columns,1,exception); for (x=0; x < (ssize_t) image->columns; x++) { - SetPixelIndex(image,FindColor(image,&image->colormap[(ssize_t) + SetPixelIndex(image,FindColor(&image->colormap[(ssize_t) GetPixelIndex(image,q)]),q); q+=GetPixelChannels(image); } diff --git a/coders/tiff.c b/coders/tiff.c index 8baec0888..6a49a2404 100644 --- a/coders/tiff.c +++ b/coders/tiff.c @@ -2343,7 +2343,7 @@ static MagickBooleanType EncodeLabImage(Image *image,ExceptionInfo *exception) } static MagickBooleanType GetTIFFInfo(const ImageInfo *image_info, - const Image *image,TIFF *tiff,TIFFInfo *tiff_info) + TIFF *tiff,TIFFInfo *tiff_info) { const char *option; @@ -3250,7 +3250,7 @@ static MagickBooleanType WriteTIFFImage(const ImageInfo *image_info, /* Write image scanlines. */ - if (GetTIFFInfo(image_info,image,tiff,&tiff_info) == MagickFalse) + if (GetTIFFInfo(image_info,tiff,&tiff_info) == MagickFalse) ThrowWriterException(ResourceLimitError,"MemoryAllocationFailed"); quantum_info->endian=LSBEndian; pixels=GetQuantumPixels(quantum_info); diff --git a/coders/vid.c b/coders/vid.c index a95007e52..da9c470bc 100644 --- a/coders/vid.c +++ b/coders/vid.c @@ -170,8 +170,8 @@ static Image *ReadVIDImage(const ImageInfo *image_info,ExceptionInfo *exception) CatchException(exception); if (next_image == (Image *) NULL) break; - label=InterpretImageProperties(image_info,next_image,DefaultTileLabel, - exception); + label=InterpretImageProperties((ImageInfo *) image_info,next_image, + DefaultTileLabel,exception); (void) SetImageProperty(next_image,"label",label,exception); label=DestroyString(label); if (image_info->debug != MagickFalse) diff --git a/coders/webp.c b/coders/webp.c index 835b09178..34864f60a 100644 --- a/coders/webp.c +++ b/coders/webp.c @@ -181,7 +181,7 @@ static MagickBooleanType IsWEBPImageLossless(const unsigned char *stream, Read extended header. */ offset=RIFF_HEADER_SIZE+TAG_SIZE+CHUNK_SIZE_BYTES+VP8X_CHUNK_SIZE; - while (offset <= length) + while (offset <= (ssize_t) length) { uint32_t chunk_size, @@ -566,7 +566,7 @@ static MagickBooleanType WriteWEBPImage(const ImageInfo *image_info, for (x=0; x < (ssize_t) image->columns; x++) { *q++=(uint32_t) (image->alpha_trait == BlendPixelTrait ? - ScaleQuantumToChar(GetPixelAlpha(image,p)) << 24 : 0xff000000u) | + ScaleQuantumToChar(GetPixelAlpha(image,p)) << 24 : 0xff000000) | (ScaleQuantumToChar(GetPixelRed(image,p)) << 16) | (ScaleQuantumToChar(GetPixelGreen(image,p)) << 8) | (ScaleQuantumToChar(GetPixelBlue(image,p))); diff --git a/coders/wmf.c b/coders/wmf.c index a17968568..921126b9a 100644 --- a/coders/wmf.c +++ b/coders/wmf.c @@ -451,6 +451,7 @@ int magick_progress_callback(void *context,float quantum) MagickBooleanType status; + (void) quantum; image=(Image *) context; assert(image->signature == MagickSignature); status=SetImageProgress(image,LoadImagesTag,TellBlob(image), diff --git a/coders/wpg.c b/coders/wpg.c index 9d267328e..31c08de50 100644 --- a/coders/wpg.c +++ b/coders/wpg.c @@ -900,11 +900,13 @@ static Image *ReadWPGImage(const ImageInfo *image_info, unsigned int NumOfEntries; } WPGColorMapRec; + /* typedef struct { size_t PS_unknown1; unsigned int PS_unknown2; unsigned int PS_unknown3; } WPGPSl1Record; + */ Image *image,