From: Cristy Date: Sun, 30 Sep 2018 22:49:21 +0000 (-0400) Subject: ... X-Git-Tag: 7.0.8-13~77 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=59f28acff016f6ae5e8b7e6300bcdf97e94affc9;p=imagemagick ... --- diff --git a/coders/jpeg.c b/coders/jpeg.c index 8faf68c92..f47834abf 100644 --- a/coders/jpeg.c +++ b/coders/jpeg.c @@ -2551,7 +2551,7 @@ static MagickBooleanType WriteJPEGImage(const ImageInfo *image_info, if (value != (char *) NULL) colorspace=StringToInteger(value); sampling_factor=(const char *) NULL; - if (colorspace == jpeg_info.in_color_space) + if ((J_COLOR_SPACE) colorspace == jpeg_info.in_color_space) { value=GetImageOption(image_info,"jpeg:sampling-factor"); if (value == (char *) NULL) diff --git a/coders/pict.c b/coders/pict.c index 3600c1215..e924fdb3a 100644 --- a/coders/pict.c +++ b/coders/pict.c @@ -444,7 +444,7 @@ static unsigned char *DecodeImage(Image *blob,Image *image, bytes_per_line=width; row_bytes=(size_t) (image->columns | 0x8000); if (image->storage_class == DirectClass) - row_bytes=(size_t) ((4*image->columns) | 0x8000); + row_bytes=(size_t) (4*(image->columns | 0x8000)); /* Allocate pixel and scanline buffer. */ @@ -1778,7 +1778,7 @@ static MagickBooleanType WritePICTImage(const ImageInfo *image_info, /* Allocate memory. */ - bytes_per_line=image->columns; + bytes_per_line=image->columns | 0x8000; if (storage_class == DirectClass) bytes_per_line*=image->alpha_trait != UndefinedPixelTrait ? 4 : 3; buffer=(unsigned char *) AcquireQuantumMemory(PictInfoSize,sizeof(*buffer)); diff --git a/coders/png.c b/coders/png.c index 835501b0c..1cce9fc52 100644 --- a/coders/png.c +++ b/coders/png.c @@ -4637,9 +4637,9 @@ static Image *ReadOneJNGImage(MngInfo *mng_info, chunk=(unsigned char *) RelinquishMagickMemory(chunk); - if (jng_width > 65535 || jng_height > 65535 || - (long) jng_width > GetMagickResourceLimit(WidthResource) || - (long) jng_height > GetMagickResourceLimit(HeightResource)) + if ((jng_width > 65535) || (jng_height > 65535) || + (MagickSizeType) jng_width > GetMagickResourceLimit(WidthResource) || + (MagickSizeType) jng_height > GetMagickResourceLimit(HeightResource)) { (void) LogMagickEvent(CoderEvent,GetMagickModule(), " JNG width or height too large: (%lu x %lu)",