From f069667fc85350f89c4757d3fabc95d95a70e28e Mon Sep 17 00:00:00 2001 From: cristy Date: Wed, 1 Feb 2012 23:43:06 +0000 Subject: [PATCH] --- MagickCore/property.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/MagickCore/property.c b/MagickCore/property.c index ca6be6c18..1a6e6fa9f 100644 --- a/MagickCore/property.c +++ b/MagickCore/property.c @@ -1230,7 +1230,7 @@ static MagickBooleanType GetEXIFProperty(const Image *image, } if (length < 16) return(MagickFalse); - id=(ssize_t) ReadPropertyShort(LSBEndian,exif); + id=(ssize_t) ((int) ReadPropertyShort(LSBEndian,exif)); endian=LSBEndian; if (id == 0x4949) endian=LSBEndian; @@ -1255,7 +1255,7 @@ static MagickBooleanType GetEXIFProperty(const Image *image, level=0; entry=0; tag_offset=0; - do + for (i=0; i < 1024; i++) { /* If there is anything on the stack then pop it off. @@ -1284,9 +1284,9 @@ static MagickBooleanType GetEXIFProperty(const Image *image, ssize_t components; - q=(unsigned char *) (directory+2+(12*entry)); - tag_value=(ssize_t) (ReadPropertyShort(endian,q)+tag_offset); - format=(size_t) ReadPropertyShort(endian,q+2); + q=(unsigned char *) (directory+(12*entry)+2); + tag_value=(ssize_t) ((int) ReadPropertyShort(endian,q)+tag_offset); + format=(size_t) ((int) ReadPropertyShort(endian,q+2)); if (format >= (sizeof(tag_bytes)/sizeof(*tag_bytes))) break; components=(ssize_t) ((int) ReadPropertyLong(endian,q+4)); @@ -1350,8 +1350,8 @@ static MagickBooleanType GetEXIFProperty(const Image *image, case EXIF_FMT_URATIONAL: { EXIFMultipleFractions(8,"%.20g/%.20g",(double) - ReadPropertyLong(endian,p1),(double) - ReadPropertyLong(endian,p1+4)); + ((int) ReadPropertyLong(endian,p1)),(double) + ((int) ReadPropertyLong(endian,p1+4))); break; } case EXIF_FMT_SRATIONAL: @@ -1458,7 +1458,7 @@ static MagickBooleanType GetEXIFProperty(const Image *image, size_t offset; - offset=(size_t) ReadPropertyLong(endian,p); + offset=(size_t) ((int) ReadPropertyLong(endian,p)); if ((offset < length) && (level < (MaxDirectoryStack-2))) { size_t @@ -1490,7 +1490,9 @@ static MagickBooleanType GetEXIFProperty(const Image *image, break; } } - } while (level > 0); + if (level <= 0) + break; + } return(status); } -- 2.50.1