Svg files without width and height attributes cause Memory leak / Windows crash
Posted: 2016-02-12T04:35:20-07:00
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.
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.