From: Tilman Sauerbeck Date: Wed, 2 Dec 2015 18:45:12 +0000 (+0100) Subject: DecodeTrace: Don't dereference iterator pointing at end of container. X-Git-Tag: pulseview-0.3.0~36 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=5da5d0813b0253fbe430d3a0b7cb780df1dcb72a;p=pulseview.git DecodeTrace: Don't dereference iterator pointing at end of container. --- diff --git a/pv/view/decodetrace.cpp b/pv/view/decodetrace.cpp index 38cbecb8..020ce770 100644 --- a/pv/view/decodetrace.cpp +++ b/pv/view/decodetrace.cpp @@ -733,7 +733,9 @@ QComboBox* DecodeTrace::create_channel_selector( { selector->addItem(s->name(), qVariantFromValue((void*)s.get())); - if ((*channel_iter).second == s) + + if (channel_iter != dec->channels().end() && + (*channel_iter).second == s) selector->setCurrentIndex( selector->count() - 1); }