From: Soeren Apel Date: Sat, 18 Mar 2017 11:12:41 +0000 (+0100) Subject: Session: Make sure we don't try to add a non-existant decoder X-Git-Tag: pulseview-0.4.0~136 X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=commitdiff_plain;h=a7336fb2d5df57b2ac28db6a2e38c337463fcdce Session: Make sure we don't try to add a non-existant decoder This can happen if either the saved configuration is wrong or a decoder simply doesn't exist. We don't want to crash then. --- diff --git a/pv/session.cpp b/pv/session.cpp index fb7d6379..0056e460 100644 --- a/pv/session.cpp +++ b/pv/session.cpp @@ -620,6 +620,9 @@ const unordered_set< shared_ptr > Session::signalbases() const #ifdef ENABLE_DECODE bool Session::add_decoder(srd_decoder *const dec) { + if (!dec) + return false; + map > channels; shared_ptr decoder_stack;