Commit | Line | Data |
---|---|---|
2ed74cea LC |
1 | This patch works around a segmentation fault in 'Magick++/tests/color' when |
2 | running 'Magick++/tests/tests.tap'. Here we get an exception early on, which | |
3 | is supposedly harmless: | |
4 | ||
5 | Caught exception: color: UnableToOpenConfigureFile `colors.xml' @ warning/configure.c/GetConfigureOptions/706 | |
6 | ||
7 | However, when the stack unwinders run, 'UnregisterDOTImage' gets called even | |
8 | though 'RegisterDOTImage' hadn't been called yet; thus, 'graphic_context' in | |
9 | coders/dot.c is NULL, leading to the segfault. | |
10 | ||
11 | --- ImageMagick-6.9.2-1/coders/dot.c 2015-09-16 17:32:42.900323334 +0200 | |
12 | +++ ImageMagick-6.9.2-1/coders/dot.c 2015-09-16 17:32:48.312367636 +0200 | |
13 | @@ -240,6 +240,7 @@ ModuleExport void UnregisterDOTImage(voi | |
14 | (void) UnregisterMagickInfo("GV"); | |
15 | (void) UnregisterMagickInfo("DOT"); | |
16 | #if defined(MAGICKCORE_GVC_DELEGATE) | |
17 | + if (graphic_context != NULL) | |
18 | gvFreeContext(graphic_context); | |
19 | #endif | |
20 | } |