Hi All,
On reading some svg files ImageMagick crashes a process (if we are using 32-bit process) or crashes Windows 10 (if we are using 64-bit process). To reproduce the issue you can use this code
static void Main(string[] args)
{
for (int i=0; i<100000; i++)
{
MagickImage oMagic = new MagickImage(@"C:\Users\Roman\Documents\tasks\test\2137.svg");
oMagic.Dispose();
}
}
On 32-bit process error is "failed to alllocate 4088 bytes (alignment: 4096): Not enough space.
Tested with the latest Magick.NET-7.0.0.0101-Q16-x64.zip. It's needed to say that standard ImageMagick's command convert also doesn't work (error is: "no images defined").
In this svg file height and width attributes are absent in <svg> element. If I add height and width then everything works as expected.
I think it's ok to have ImageMagick's error "no images defined" but it's not OK to have memory leak. You can take svg to test here: http://1drv.ms/1PqVkfT
Thanks.
Svg files without width and height attributes cause Memory leak / Windows crash
Re: Svg files without width and height attributes cause Memory leak / Windows crash
Thank you for reporting this. I just pushed a patch to our ImageMagick GIT repository to fix this. I will publish a new release of Magick.NET this weekend that will include this fix.
Re: Svg files without width and height attributes cause Memory leak / Windows crash
Just checked update -> now the above code throws the 'ImageMagick.MagickMissingDelegateErrorException' exception. I assume that it's the expected behavior. Thanks again.
Re: Svg files without width and height attributes cause Memory leak / Windows crash
That is indeed the expected behavior.