From 4662a13513c15a6545b44bead832ebcbdcf522ca Mon Sep 17 00:00:00 2001 From: cristy Date: Mon, 19 Jan 2015 19:27:00 +0000 Subject: [PATCH] --- MagickCore/string.c | 19 ++++++++----------- MagickCore/xml-tree.c | 4 +--- coders/sun.c | 2 +- 3 files changed, 10 insertions(+), 15 deletions(-) diff --git a/MagickCore/string.c b/MagickCore/string.c index a84b56e80..112018ebc 100644 --- a/MagickCore/string.c +++ b/MagickCore/string.c @@ -938,17 +938,14 @@ MagickExport char *EscapeString(const char *source,const char escape) if (destination == (char *) NULL) ThrowFatalException(ResourceLimitFatalError,"UnableToEscapeString"); *destination='\0'; - if (source != (char *) NULL) - { - q=destination; - for (p=source; *p != '\0'; p++) - { - if ((*p == '\\') || (*p == escape)) - *q++='\\'; - *q++=(*p); - } - *q='\0'; - } + q=destination; + for (p=source; *p != '\0'; p++) + { + if ((*p == '\\') || (*p == escape)) + *q++='\\'; + *q++=(*p); + } + *q='\0'; return(destination); } diff --git a/MagickCore/xml-tree.c b/MagickCore/xml-tree.c index 067f881c9..112219cf4 100644 --- a/MagickCore/xml-tree.c +++ b/MagickCore/xml-tree.c @@ -2776,9 +2776,7 @@ MagickExport char *XMLTreeInfoToXML(XMLTreeInfo *xml_info) root=(XMLTreeRoot *) xml_info; while (root->root.parent != (XMLTreeInfo *) NULL) root=(XMLTreeRoot *) root->root.parent; - parent=(XMLTreeInfo *) NULL; - if (xml_info != (XMLTreeInfo *) NULL) - parent=xml_info->parent; + parent=xml_info->parent; if (parent == (XMLTreeInfo *) NULL) for (i=0; root->processing_instructions[i] != (char **) NULL; i++) { diff --git a/coders/sun.c b/coders/sun.c index 3f71a1eda..b5fed9c2b 100644 --- a/coders/sun.c +++ b/coders/sun.c @@ -408,7 +408,7 @@ static Image *ReadSUNImage(const ImageInfo *image_info,ExceptionInfo *exception) if ((sun_info.length*sizeof(*sun_data))/sizeof(*sun_data) != sun_info.length || !sun_info.length) ThrowReaderException(ResourceLimitError,"ImproperImageHeader"); - number_pixels=(MagickSizeType) image->columns*image->rows; + number_pixels=(MagickSizeType) (image->columns*image->rows); if ((sun_info.type != RT_ENCODED) && ((number_pixels*sun_info.depth) > (8*sun_info.length))) ThrowReaderException(CorruptImageError,"ImproperImageHeader"); -- 2.40.0