summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorKonstantin Käfer <mail@kkaefer.com>2018-01-23 13:03:57 -0800
committerKonstantin Käfer <mail@kkaefer.com>2018-01-23 13:56:42 -0800
commit3f7c30f9d3716bcf1ebea617a38aebe1401e20a1 (patch)
tree07ec32304d560074904873561eaf8d02812251dc /include
parent14f3f86f6347c5d4ec2d9fe9d0ca8b05e6b06932 (diff)
downloadqtlocation-mapboxgl-3f7c30f9d3716bcf1ebea617a38aebe1401e20a1.tar.gz
[core] fix style parsing crash when a layer's paint property is not an object
Diffstat (limited to 'include')
-rw-r--r--include/mbgl/style/conversion/layer.hpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/mbgl/style/conversion/layer.hpp b/include/mbgl/style/conversion/layer.hpp
index 1fe467165d..c694c3162a 100644
--- a/include/mbgl/style/conversion/layer.hpp
+++ b/include/mbgl/style/conversion/layer.hpp
@@ -43,6 +43,9 @@ optional<Error> setPaintProperties(Layer& layer, const V& value) {
if (!paintValue) {
return {};
}
+ if (!isObject(*paintValue)) {
+ return { { "paint must be an object" } };
+ }
return eachMember(*paintValue, [&] (const std::string& k, const V& v) {
return setPaintProperty(layer, k, v);
});