]> granicus.if.org Git - imagemagick/blobdiff - coders/svg.c
Added support for writing RLE compressed TGA files.
[imagemagick] / coders / svg.c
index 227bd848a9c34a97f0297b715d3ac82bbee6aff8..e94646142b429ed9e6b36062aa4fbe82416e97cf 100644 (file)
@@ -278,7 +278,7 @@ static SVGInfo *DestroySVGInfo(SVGInfo *svg_info)
   if (svg_info->text != (char *) NULL)
     svg_info->text=DestroyString(svg_info->text);
   if (svg_info->scale != (double *) NULL)
-    svg_info->scale=(double *) (svg_info->scale);
+    svg_info->scale=(double *) RelinquishMagickMemory(svg_info->scale);
   if (svg_info->title != (char *) NULL)
     svg_info->title=DestroyString(svg_info->title);
   if (svg_info->comment != (char *) NULL)
@@ -3074,9 +3074,14 @@ static Image *ReadSVGImage(const ImageInfo *image_info,ExceptionInfo *exception)
   /*
     Parse SVG file.
   */
+  if (image == (Image *) NULL)
+    return((Image *) NULL);
   svg_info=AcquireSVGInfo();
   if (svg_info == (SVGInfo *) NULL)
-    ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed");
+    {
+      (void) fclose(file);
+      ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed");
+    }
   svg_info->file=file;
   svg_info->exception=exception;
   svg_info->image=image;
@@ -3234,6 +3239,7 @@ ModuleExport size_t RegisterSVGImage(void)
   entry->blob_support=MagickFalse;
   entry->seekable_stream=MagickFalse;
   entry->description=ConstantString("Scalable Vector Graphics");
+  entry->mime_type=ConstantString("image/svg+xml");
   if (*version != '\0')
     entry->version=ConstantString(version);
   entry->magick=(IsImageFormatHandler *) IsSVG;
@@ -3247,6 +3253,7 @@ ModuleExport size_t RegisterSVGImage(void)
   entry->blob_support=MagickFalse;
   entry->seekable_stream=MagickFalse;
   entry->description=ConstantString("Compressed Scalable Vector Graphics");
+  entry->mime_type=ConstantString("image/svg+xml");
   if (*version != '\0')
     entry->version=ConstantString(version);
   entry->magick=(IsImageFormatHandler *) IsSVG;