From 3fbe7f61a6cda5518ddde5dc8df80af60d20ece7 Mon Sep 17 00:00:00 2001 From: Mickey Rose Date: Wed, 22 Feb 2017 03:21:48 +0100 Subject: [PATCH] load_map: avoid segfault when ShieldSymbolizer has invalid placements --- src/load_map.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/load_map.cpp b/src/load_map.cpp index 08565baa5..8969ce5c7 100644 --- a/src/load_map.cpp +++ b/src/load_map.cpp @@ -1155,10 +1155,14 @@ void map_parser::parse_shield_symbolizer(rule & rule, xml_node const& node) if (placement_type) { placements = placements::registry::instance().from_xml(*placement_type, node, fontsets_, true); - } else { - placements = std::make_shared(); + if (!placements) + return; + } + else + { + placements = std::make_shared(); + placements->defaults.from_xml(node, fontsets_, true); } - placements->defaults.from_xml(node, fontsets_, true); if (strict_ && !placements->defaults.format_defaults.fontset) {