From fa6de8c321ddfb1c035dcb0901b917b67461dbef Mon Sep 17 00:00:00 2001 From: cristy Date: Sun, 18 May 2014 16:34:44 +0000 Subject: [PATCH] --- MagickCore/mime.c | 12 ++++++------ MagickCore/xml-tree.c | 2 +- coders/bmp.c | 6 +++--- coders/png.c | 11 +++++------ coders/sgi.c | 4 ++-- 5 files changed, 17 insertions(+), 18 deletions(-) diff --git a/MagickCore/mime.c b/MagickCore/mime.c index a441bcd67..25a71830b 100644 --- a/MagickCore/mime.c +++ b/MagickCore/mime.c @@ -341,16 +341,16 @@ MagickExport const MimeInfo *GetMimeInfo(const char *filename, if (endian == LSBEndian) { value=(ssize_t) (*q++); - value|=(*q++) << 8; - value|=(*q++) << 16; - value|=(*q++) << 24; + value|=((ssize_t) *q++) << 8; + value|=((ssize_t) *q++) << 16; + value|=((ssize_t) *q++) << 24; } else { value=(ssize_t) (*q++) << 24; - value|=(*q++) << 16; - value|=(*q++) << 8; - value|=(*q++); + value|=((ssize_t) *q++) << 16; + value|=((ssize_t) *q++) << 8; + value|=((ssize_t) *q++); } if (p->mask == 0) { diff --git a/MagickCore/xml-tree.c b/MagickCore/xml-tree.c index e136a5d63..8fc693a82 100644 --- a/MagickCore/xml-tree.c +++ b/MagickCore/xml-tree.c @@ -1683,7 +1683,7 @@ static void ParseProcessingInstructions(XMLTreeRoot *root,char *xml, ThrowFatalException(ResourceLimitFatalError,"MemoryAllocationFailed"); root->processing_instructions[i][j+2]=(char *) ResizeQuantumMemory( root->processing_instructions[i][j+1],(size_t) (j+1), - sizeof(**root->processing_instructions)); + sizeof(*root->processing_instructions)); if (root->processing_instructions[i][j+2] == (char *) NULL) ThrowFatalException(ResourceLimitFatalError,"MemoryAllocationFailed"); (void) CopyMagickString(root->processing_instructions[i][j+2]+j-1, diff --git a/coders/bmp.c b/coders/bmp.c index 7e453cc04..43b71d7c2 100644 --- a/coders/bmp.c +++ b/coders/bmp.c @@ -1267,9 +1267,9 @@ static Image *ReadBMPImage(const ImageInfo *image_info,ExceptionInfo *exception) for (x=0; x < (ssize_t) image->columns; x++) { pixel=(size_t) (*p++); - pixel|=(*p++ << 8); - pixel|=(*p++ << 16); - pixel|=(*p++ << 24); + pixel|=((size_t) *p++ << 8); + pixel|=((size_t) *p++ << 16); + pixel|=((size_t) *p++ << 24); red=((pixel & bmp_info.red_mask) << shift.red) >> 16; if (quantum_bits.red == 8) red|=(red >> 8); diff --git a/coders/png.c b/coders/png.c index c51b96a64..43c62cbdc 100644 --- a/coders/png.c +++ b/coders/png.c @@ -12775,7 +12775,7 @@ static MagickBooleanType WriteOneJNGImage(MngInfo *mng_info, register ssize_t i; - ssize_t + size_t len; /* Write IDAT chunk header */ @@ -12795,11 +12795,10 @@ static MagickBooleanType WriteOneJNGImage(MngInfo *mng_info, if (*(p)==73 && *(p+1)==68 && *(p+2)==65 && *(p+3)==84) /* IDAT */ { /* Found an IDAT chunk. */ - (void) WriteBlobMSBULong(image,(size_t) len); - LogPNGChunk(logging,mng_IDAT,(size_t) len); - (void) WriteBlob(image,(size_t) len+4,p); - (void) WriteBlobMSBULong(image, - crc32(0,p,(uInt) len+4)); + (void) WriteBlobMSBULong(image,len); + LogPNGChunk(logging,mng_IDAT,len); + (void) WriteBlob(image,len+4,p); + (void) WriteBlobMSBULong(image, crc32(0,p,(uInt) len+4)); } else diff --git a/coders/sgi.c b/coders/sgi.c index d3c9a420d..8ece34cd5 100644 --- a/coders/sgi.c +++ b/coders/sgi.c @@ -1088,8 +1088,8 @@ static MagickBooleanType WriteSGIImage(const ImageInfo *image_info,Image *image, /* Convert SGI uncompressed pixels. */ - offsets=(ssize_t *) AcquireQuantumMemory(iris_info.rows*iris_info.depth, - sizeof(*offsets)); + offsets=(ssize_t *) AcquireQuantumMemory(iris_info.rows, + iris_info.depth*sizeof(*offsets)); runlength=(size_t *) AcquireQuantumMemory(iris_info.rows, iris_info.depth*sizeof(*runlength)); packet_info=AcquireVirtualMemory((2*(size_t) iris_info.columns+10)* -- 2.40.0