]> granicus.if.org Git - imagemagick/commitdiff
(no commit message)
authorcristy <urban-warrior@git.imagemagick.org>
Sun, 8 Feb 2015 13:43:46 +0000 (13:43 +0000)
committercristy <urban-warrior@git.imagemagick.org>
Sun, 8 Feb 2015 13:43:46 +0000 (13:43 +0000)
coders/svg.c

index e83d656bfbe44a456adeb140091abda75df109f2..f4a7cecbcb11af6f75451e062e94a3291ab17bbc 100644 (file)
@@ -36,7 +36,7 @@
 %
 %
 */
-
+\f
 /*
   Include declarations.
 */
@@ -99,7 +99,7 @@
 #include "librsvg/librsvg-features.h"
 #endif
 #endif
-
+\f
 /*
   Typedef declarations.
 */
@@ -184,13 +184,13 @@ typedef struct _SVGInfo
     document;
 #endif
 } SVGInfo;
-
+\f
 /*
   Forward declarations.
 */
 static MagickBooleanType
   WriteSVGImage(const ImageInfo *,Image *,ExceptionInfo *);
-
+\f
 /*
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 %                                                                             %
@@ -2832,7 +2832,7 @@ static Image *ReadSVGImage(const ImageInfo *image_info,ExceptionInfo *exception)
             attributes;
 
           /*
-            Our best hope for compliance to the SVG standard.
+            Our best hope of compliance with the SVG standard.
           */
           status=AcquireUniqueSymbolicLink(image->filename,input_filename);
           (void) AcquireUniqueFilename(output_filename);
@@ -2856,17 +2856,23 @@ static Image *ReadSVGImage(const ImageInfo *image_info,ExceptionInfo *exception)
           if ((status == 0) && (stat(output_filename,&attributes) == 0) &&
               (attributes.st_size != 0))
             {
+              Image
+                *svg_image;
+
               ImageInfo
                 *read_info;
 
               read_info=CloneImageInfo(image_info);
               (void) CopyMagickString(read_info->filename,output_filename,
                 MaxTextExtent);
-              image=ReadImage(read_info,exception);
+              svg_image=ReadImage(read_info,exception);
               read_info=DestroyImageInfo(read_info);
               (void) RelinquishUniqueFileResource(output_filename);
-              if (image != (Image *) NULL)
-                return(image);
+              if (svg_image != (Image *) NULL)
+                {
+                  image=DestroyImage(image);
+                  return(svg_image);
+                }
             }
           (void) RelinquishUniqueFileResource(output_filename);
         }
@@ -3192,7 +3198,7 @@ static Image *ReadSVGImage(const ImageInfo *image_info,ExceptionInfo *exception)
   return(GetFirstImageInList(image));
 }
 #endif
-
+\f
 /*
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 %                                                                             %
@@ -3279,7 +3285,7 @@ ModuleExport size_t RegisterSVGImage(void)
   (void) RegisterMagickInfo(entry);
   return(MagickImageCoderSignature);
 }
-
+\f
 /*
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 %                                                                             %
@@ -3308,7 +3314,7 @@ ModuleExport void UnregisterSVGImage(void)
   xmlCleanupParser();
 #endif
 }
-
+\f
 /*
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 %                                                                             %