diff options
author | Konstantin Käfer <mail@kkaefer.com> | 2018-01-23 13:03:57 -0800 |
---|---|---|
committer | Konstantin Käfer <mail@kkaefer.com> | 2018-01-23 13:56:42 -0800 |
commit | 3f7c30f9d3716bcf1ebea617a38aebe1401e20a1 (patch) | |
tree | 07ec32304d560074904873561eaf8d02812251dc /include | |
parent | 14f3f86f6347c5d4ec2d9fe9d0ca8b05e6b06932 (diff) | |
download | qtlocation-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.hpp | 3 |
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); }); |