projects
/
pulseview.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
04e1acc
)
Session: Make sure we don't try to add a non-existant decoder
author
Soeren Apel
<soeren@apelpie.net>
Sat, 18 Mar 2017 11:12:41 +0000
(12:12 +0100)
committer
Soeren Apel
<soeren@apelpie.net>
Wed, 22 Mar 2017 21:47:26 +0000
(22:47 +0100)
This can happen if either the saved configuration is wrong
or a decoder simply doesn't exist. We don't want to crash then.
pv/session.cpp
patch
|
blob
|
history
diff --git
a/pv/session.cpp
b/pv/session.cpp
index fb7d6379c2a6af1b613e410b3f68e5e1239e1e52..0056e460b81ad92b2ef075bc43014914bd16ba3e 100644
(file)
--- a/
pv/session.cpp
+++ b/
pv/session.cpp
@@
-620,6
+620,9
@@
const unordered_set< shared_ptr<data::SignalBase> > Session::signalbases() const
#ifdef ENABLE_DECODE
bool Session::add_decoder(srd_decoder *const dec)
{
+ if (!dec)
+ return false;
+
map<const srd_channel*, shared_ptr<data::SignalBase> > channels;
shared_ptr<data::DecoderStack> decoder_stack;