[vlmc-devel] Settings: Fix segfault when SettingValue is null
Yikai Lu
git at videolan.org
Tue Jun 6 18:19:10 CEST 2017
vlmc | branch: master | Yikai Lu <luyikei.qmltu at gmail.com> | Mon Jun 5 16:30:56 2017 +0900| [b4d7c49167cc249d82cee123e68648444b20320c] | committer: Yikai Lu
Settings: Fix segfault when SettingValue is null
> https://code.videolan.org/videolan/vlmc/commit/b4d7c49167cc249d82cee123e68648444b20320c
---
src/Settings/Settings.cpp | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/Settings/Settings.cpp b/src/Settings/Settings.cpp
index 097eb80d..6f84e737 100644
--- a/src/Settings/Settings.cpp
+++ b/src/Settings/Settings.cpp
@@ -169,7 +169,10 @@ Settings::loadJsonFrom( const QJsonObject &object )
SettingValue* val = value( it.key() );
if ( val == nullptr )
+ {
vlmcWarning() << "Loaded invalid project setting:" << it.key();
+ continue;
+ }
if ( val->type() == SettingValue::ByteArray )
val->set( QByteArray::fromBase64( (*it).toVariant().toByteArray() ) );
More information about the Vlmc-devel
mailing list