From: cristy Date: Thu, 13 Mar 2014 17:04:24 +0000 (+0000) Subject: (no commit message) X-Git-Tag: 7.0.1-0~2589 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3fb795852832f719cd773965932d46d3493d12c0;p=imagemagick --- diff --git a/MagickCore/profile.c b/MagickCore/profile.c index a1c8f4d47..b7c71e53d 100644 --- a/MagickCore/profile.c +++ b/MagickCore/profile.c @@ -1119,7 +1119,7 @@ static inline const unsigned char *ReadResourceBytes(const unsigned char *p, } static inline const unsigned char *ReadResourceLong(const unsigned char *p, - size_t *quantum) + unsigned int *quantum) { *quantum=(size_t) (*p++ << 24); *quantum|=(size_t) (*p++ << 16); @@ -1154,9 +1154,12 @@ static MagickBooleanType GetProfilesFromResourceBlock(Image *image, unsigned char length_byte; - size_t + ssize_t count; + unsigned int + value; + unsigned short id; @@ -1174,19 +1177,20 @@ static MagickBooleanType GetProfilesFromResourceBlock(Image *image, p++; if (p > (datum+length-4)) break; - p=ReadResourceLong(p,&count); + p=ReadResourceLong(p,&value); + count=(ssize_t) value; if ((p > (datum+length-count)) || (count > length)) break; switch (id) { case 0x03ed: { - unsigned short - units; - unsigned int resolution; + unsigned short + units; + /* Resolution. */ @@ -1195,15 +1199,17 @@ static MagickBooleanType GetProfilesFromResourceBlock(Image *image, p=ReadResourceShort(p,&units)+2; p=ReadResourceLong(p,&resolution)+4; image->resolution.y=((double) resolution)/65536.0; - // Values are always stored as pixels per inch. - if ((ResolutionType) units == PixelsPerCentimeterResolution) + /* + Values are always stored as pixels per inch. + */ + if ((ResolutionType) units != PixelsPerCentimeterResolution) + image->units=PixelsPerInchResolution; + else { image->units=PixelsPerCentimeterResolution; image->resolution.x/=2.54; image->resolution.y/=2.54; } - else - image->units=PixelsPerInchResolution; break; } case 0x0404: @@ -1736,4 +1742,4 @@ MagickPrivate MagickBooleanType SyncImageProfiles(Image *image) if (SyncExifProfile(image,profile) == MagickFalse) status=MagickFalse; return(status); -} \ No newline at end of file +} diff --git a/MagickCore/resize.c b/MagickCore/resize.c index 8c044a635..dee437eec 100644 --- a/MagickCore/resize.c +++ b/MagickCore/resize.c @@ -2459,6 +2459,9 @@ static MagickBooleanType HorizontalFilter(const ResizeFilter *resize_filter, #endif for (x=0; x < (ssize_t) resize_image->columns; x++) { + const int + id = GetOpenMPThreadId(); + double bisect, density; @@ -2486,7 +2489,7 @@ static MagickBooleanType HorizontalFilter(const ResizeFilter *resize_filter, start=(ssize_t) MagickMax(bisect-support+0.5,0.0); stop=(ssize_t) MagickMin(bisect+support+0.5,(double) image->columns); density=0.0; - contribution=contributions[GetOpenMPThreadId()]; + contribution=contributions[id]; for (n=0; n < (stop-start); n++) { contribution[n].pixel=start+n; @@ -2669,6 +2672,9 @@ static MagickBooleanType VerticalFilter(const ResizeFilter *resize_filter, #endif for (y=0; y < (ssize_t) resize_image->rows; y++) { + const int + id = GetOpenMPThreadId(); + double bisect, density; @@ -2696,7 +2702,7 @@ static MagickBooleanType VerticalFilter(const ResizeFilter *resize_filter, start=(ssize_t) MagickMax(bisect-support+0.5,0.0); stop=(ssize_t) MagickMin(bisect+support+0.5,(double) image->rows); density=0.0; - contribution=contributions[GetOpenMPThreadId()]; + contribution=contributions[id]; for (n=0; n < (stop-start); n++) { contribution[n].pixel=start+n;